Tuesday, May 20, 2008

Beliefs on climate change as a function of party affiliation and education

Here's the Pew research center report, which is awesome and full of raw data. And here's the key graph:


Forget the specific issue of climate change. This is more evidence that politics is the mind killer.

On a side note, Jon Stewart is the only guy I'll watch these days, I saw him interview McCain last night and it was actually fairly funny.

Tuesday Statisticz: The rides at Six Flag's Great Adventure

Danny posted these rankings of rides at Super Flag's Great Adventure and telepathically asked me to analyze it to try to find some cool stuff from the data. No problem! It's sort of screwed up, since Jay voted for two rides as #1 (both Kingda Ka and Superman), but I guess if he's cool enough to have a blog with no posts, he's cool enough to vote for have two #1s. He's like the dad in those Verizon commercial.

First, here's the ranking of the rides as determined by their median values:

1) Kingda Ka
2) Nitro
3) Superman
4) El Toro
5) Medusa
6) Batman
7) Scream Machine
8) Skull Mountain
9) Dark Knight

Next, here's the same rankings with standard deviations included, to give a sense of the variance in the votes. Note that almost all of the variance in Dark Knight's ranking came from one data point, much to Danny's chagrin. He called the perpetrator a bad name, which is unfair. Maybe he just really liked Dark Knight?


The variance is actually fairly low, which makes me question whether or not the rankings were entirely independent. Rob and Tyson have exactly the same rankings, which is suspicious on a number of levels.

Finally, I wanted to see why they would rank the rides in this way. I went to Great Adventure's website, and looked at some statistics from each of the rides. First, the rides are all ranked in terms of thrill levels as either "mild," "moderate," or "max." The two rides that these guys ranked lowest, Skull Mountain and Scream Machine, were both "moderate," while the rest of the rides were "max." Next, I wondered if there was a correlation between ride speed and the rankings. But for this we need another chart:

As the maximum speed of the ride decreases, the ranking of the ride decreases as well. There is a strong correlation here, with an r square of 0.659, which is significant with a t=2.146, df = 6, and a one-tailed p = 0.038. I must also note that there are only 8 data points on here, although there were 9 rides. This is because the ride that the group rated the worst, Dark Knight, didn't even have a listing of its maximum speed. I can only presume that Great Adventures didn't list the speed because it is embarrassingly slow, which would have helped improve the correlation.

Anyways, it seems like these Vassar students prefer fast rides to slow ones. Congrats on all graduating, too.

Wednesday, May 14, 2008

Forgive and forget, forgotten

"If you shoot my dog, imma kill your cat." - Jay Z

Joe Ward writes about how other people have stuff going on in their lives too, so we should forgive them for their annoying transgressions. Forgive and forget, right?

I've talked before about how bad our first impressions are, and suggested that we attempt to get past them as soon as possible. I think about this all the time. But does it "accomplish" anything, and actually change our behavior?

Eric Schwitzgebel has an awesome blog where he talks about this exact problem, based on the experimental result that ethics professors don't act any more ethically than anybody else. If people that think about ethics all the time don't act any better, how can the poor ethical layman like myself hope to do any better?

I don't know if I can, but I'm sure that it's worth my best shot. Like Marcus Aurelius says in his Meditations,

"Either the world is a mere hotch-potch of random cohesions and dispersions, or else it is a unity of order and providence. If it is the former, why wish to survive in such a purposeless or chaotic confusion; why care about anything, save the manner of ultimate return to dust; why trouble my head at all, since, do what I will, dispersion will overtake me sooner or later? But if the contrary be true, then I do reverence, I stand firmly, and I put my trust in the directing power."

Priests and shamans alike can quibble over the nature of that power, but the desire to do stand firm is practically universal. We can tell ourselves to forgive and forget all day, but in the throes of the moment can we stop our sympathetic nervous system from triggering upon perceiving a threat? Will our blood pressure not rise? I doubt it.

Being human means getting annoyed when you call fives and somebody takes your seat anyways. But maybe being human can also mean forgiving that person after reflection, a month later, on your blog. I don't know. I'll probably never know for sure.

Tuesday, May 13, 2008

Tuesday Statisticz: Breaking down the success of superhero movies

Obviously, Jon Favreau's Iron Man has been a huge hit at the box office thus far, and it has done surprisingly well on imdb as well. Currently it is rated 8.3 and #133 on the top 250, but those numbers will drop after a few months like they always do with new movies.

I naturally began to wonder what specific factors lead these superhero movies to do well at the box office. I refined my search to movies within the past 6 years that feature one main superhero, which excludes X-Men are the Fantastic Four, as well as any wack older movies. Here's a chart with imdb's weighted rating (accessed May 13 on imdb) on the y-axis and total US gross box office numbers (found here) on the x-axis:

There's a definite correlation here, with a pretty high r squared of 0.356. But there are some deviations from the trend line. Hellboy made much less money based on what we'd expect from it's imdb rating (rated 6.7, grossed $59,000,000), while Spider-Man 3 made substantially more money than we'd expect (rated 6.6, grossed #$336,000,000).

Why did Spider-Man 3 make so much more? A quick glance at their demographics (found here and here) shows that Spider-Man 3 did much better in the category of females under 18. While they are not huge voters on imdb, experience tells us that young women go to the movies in droves. So here's a chart with females less than 18's ratings versus the total US gross box office numbers:

As you can see, there is a high correlation here as well (with an r squared of 0.399), although that is to be expected since females under 18 are one constituency of imdb's total votes. Although this chart tells us that we may be on the right track, what we are really looking for is the difference in ratings between females under 18 and the total ratings, versus the deviations from the trendline that we found in our first chart. We want to find out if the ratings of females under 18 can explain those deviations. So here's a chart:

While the r squared value of 0.177 is not as high here as in the previous two charts, it is more interesting because it's non-intuitive. Who would have thought that young girls would have such an impact on the box office numbers of movies based on comic book characters, which you would assume to be male-targeted audience? The other possibility is that the females under 18 on imdb are one of the only groups that don't self-censor their own ratings. Perhaps they vote based on their own levels of enjoyment instead of considering how others in the future will judge them.

The trendline in the first chart predicts that Iron Man will eventually gross $333 million. I would expect that the number will be a little bit lower because its rating will eventually drop from 8.3, and because females under 18 don't love it, giving it a 7.5. So my official guess is $300, up from its current total of $178 (million). Check back in a few months for the results of one of my first statistical predictions.

Monday, May 12, 2008

First good impressions

I'm throwing my hat into the ring of what makes a good teacher (as told by fellow UHS grads here and here), and I'm going to take the analysis one step further. I'm going to tell you the way you can tell if a teacher is going to be good from day one.

What you want from a teacher in the first class is for him or her to apologize. You want your teacher to say, "I'm going to do some things in this class that may annoy you, offend you, and otherwise make you mad. I know because when I have taught this before, I have received feedback from some people telling me so. But this is the way that will help you learn the material the best (because of x, y, and z), so I'm going to stick with it."

My biology teacher this semester apologized for seemingly half of our first class for any times in the future when he may offend us. I was sort of weirded out. He turned out to be funny most of the time and downright hilarious the rest, despite the class's early meeting time. I suppose he felt obligated to apologize because he had offended students in the past, but I would much rather listen to an apology one day than an exhibit in self-censorship for a whole semester.

In this era of ratemyprofessor.com, it is easy for a teacher to take the easy route and acquiesce to every individual complaint, even if it means that the majority of the students will be less well off. It's not hard to play it safe.

So if a teacher apologizes the first day for why he's not going to play it safe, I would stick around. You might just learn something after all.

Tuesday, May 6, 2008

Tuesday Statisticz: Music that makes countries rich, Part I

Alright, so the idea here was to look at the types of music that rich countries tend to listen to, without assuming too much causation but still looking for cool trends. I downloaded the 10 "Top Music" choices from different countries on Facebook's network page, only choosing networks with 100,000 plus members, because otherwise the top 10 lists aren't very representative. I found the GDP by country in 2007 here, and the population levels by country in 2007 here.

Unfortunately, I realized once I had aggregated all the data just how ambitious of a project this will be, and I'm unsure of exactly how to go about it. However, I didn't want to leave my loyal readers without anything, so I made a map on R of the countries who are included in my dataset. These are the countries that have 100,000 people in their facebook network, excluding Britian, Canada, and the US, whose networks are clustered into individual regions, making it impossible to determine their "Top Music" choices as a country. Here's the chart:

This map is fairly interesting to me in its own right. It seems that most of the international facebook use is clustered in Western Europe, Southeast Asia, and South America. I was particularly surprised to see that the "Russia" network had so few members, but maybe Putin threatened to kill anybody giving too much support to American institutions.

Anyways, check back next week for part 2. I'm excited.

Sunday, May 4, 2008

Distance, Knowledge, and Information

Dario brings up a good question in the comments about when it is acceptable to say that you are from a given city:

"I propose a statute of limitations: if you reside within a 20 mile radius of the city limits of san francisco then you can claim it for the sake of simplicity -- if not then you must own up to your actual home, regardless of how much of a pain in the ass it is to explain."

This is a good idea, but I think it only takes into account one factor, when it should also take into account how likely it is that the person you are talking to will know the small city that you are from. Things that could influence this likelihood:

1) If you ask the other person where they are from first, and they respond that they are from an area close to where you live. So in my case, if somebody said they were from Berkeley I would probably I said that I lived in Marin, not SF. Southern Californians would also probably be a safe bet to know about Marin, while your average person from Poughkeepsie would not.

2) Age. The older they are (to a given point, like 100 or so, when Alzheimer's becomes almost inevitable), the more likely they are to have visited the area, and to know the relevant suburbs. This shouldn't show as strong of an effect as the other factors, however.

3) Perceived education/intelligence. Yes. There is some crazy statistic of Americans that can't place Iraq on a map, and if it looks like the person you are talking to may be one of them (good signs include clothing from Abercrombie and Fitch, and lots of hair product), you should probably stick to bigger cities. Or maybe you should just stick to states, or locations, like by the ocean. ("Oh, sweet").

4) Where you currently are when they ask you. If you are in Madrid and somebody asks you where you're from, you'll probably say "the US." (Or "Canada" if you're street-smart and don't mind channeling your inner Benedict Arnold.) If I was in San Rafael and somebody asked me where I was from, I'd definitely say Mill Valley.

So, there is an relationship between the likelihood that they will recognize the name of the cities and how far away from where you actual live is from the major city, that determines when and where it is acceptable to say that you are from the major city. That is a complicated sentence, but this is a complicated issue.

The main point is that there are a lot of factors to juggle, and it has to be done quickly, so to blindly point fingers at somebody for saying "San Francisco" when they technically should have said "Mill Valley" seems like fiddlesticks to me.

More blogging from teachers that have given me B-plusses

Bryan van Norden posting on Eric Schwitzgebel's experimental philosophy blog. He was my teacher for Problems in Philosophy the spring semester of last year. His policy of hardly ever giving out As, which was awesome, was the reason that I wrote last year about how highly I thought of the future of philosophy.

In this post, his practical advice to grad students interested in pre-Qin dynasty Chinese philosophy has fairly little relevance to me, but his larger point that you must devote yourself to large amounts of reading in order to be useful to your field is noteworthy.

I particularly liked his point that, "if you don't know the secondary literature and I do, how productive will my conversation with you be?" If you don't know the basic facts and haven't read the influential commentaries on a subject, there's little chance that you are going to come up with an opinion that will advance the discussion with somebody that has read the relevant secondary literature.

He also has a list of the ten most important people of the 20th century, which is a fun thought experiment. If I were to make a list, I might have tried to find room for John von Neumann, Alan Turing, and/or Milton Friedman, but I probably have a bias towards scientists.

Friday, May 2, 2008

May day, May day

You shouldn't be reading this post, you should be reading Ben Casnocha's blog and staying up. Foot to the pedal, nose full of burning oil, eyes watering from too much speed. I'm not kidding either. You really should be reading his blog.

But if you're still here, maybe you'll want to hear some stuff from this week that I've realized I hate:

1) When your teacher passes out a test and allows kids to start right away, only you're on the opposite side of the room so it doesn't get to you for forever. And if somebody makes the obvious suggestion that people should wait to start until everybody has a test, they are crucified. "What is this, the PSATs? Communist Russia?" No, you idiots, this is America. But we need a proper legislative system in place before we can conduct proper competition. You're conflating regulation with intervention.

2) Is there a reason that hipsters can't wear normal backpacks? I know that you're doing everything you can to be cool, but what's so conformist about a backpack? Honestly, I'm just confused. And really annoyed.

3) When I tell people that I'm from San Francisco, they happen to know the area well, and then get mad at me when it turns out that I technically live in Mill Valley. First of all, nobody knows where on earth Mill Valley is, and second of all, nobody likes you.

Wednesday, April 30, 2008

Evolutionary psychology is fruitless without neuroscience

That's the thrust of this paper by J. Pankseep et al (hat tip: Mind Hacks). It grounds the field of evolutionary psychology by holding some of its claims to the same scientific standards necessary in other fields of evolutionary research.

One of the primary points of the paper is that human changes in brain-based behavior may be due to epigenetics and cultural selection (through exaptation, perhaps), and are not solely attributable to natural selection.

It also looks at the HPA axis and evaluates its role in regulating social interactions in animal models. It stresses the "resident-intruder" experimental set-up in rats, in which the intruder is almost always the "loser" of the social interaction and exhibits physiological changes following this defeat, including loss of weight, testicular regression, and increased fearfulness. These changes are especially evident when the "loser" rat is not placed back in a social housing condition but is instead housed in isolation. While we should be careful not to excessively generalize these findings to humans, they are obviously exciting.

Well worth a read for those interested in either field.

Tuesday, April 29, 2008

Tuesday Statisticz: Dog Parks and City Safety

I wanted to see if parks had any correlation with city safety. My a priori expectation was that more parks would make a city safer, because I normally think of park goers as law abiding citizens. But then I happened upon this chart showing the number of dog parks in various cities, which I thought was even cooler. So I went back to these old crime statistics from 2006 (the "offenses known to law enforcement") and correlated the amount of crime in US cities with the number of dog parks in them. Here is a chart showing dog parks versus property crime:


Each of the dots represents one city, with a distinct crime rate and number of dog parks per capita. As you can see, r square here is nonexistent. There is no correlation. Next, here's dog parks versus violent crime:


I couldn't combine these charts because the y-axis values of the two data sets are so different, since there are many more property crimes than violent ones. In this chart, there appears to be an inverse relationship, although it is small, with an r square of merely 0.023. But is it significant? A student's t-test (t=1.18, p > .05) tells us no. So for all intents and purposes, there's nothing going on here.

Finally, just for fun, dog parks and arson:

Once again, there is nothing of importance here. Although I do like that shade of orange.

What can we draw from these statistics? For one thing, maybe a park isn't as effective a way to reduce crime as I had assumed. I suppose that growing up in picnic-central Mill Valley may have created this perception.

Also, this data gives us no reason to suspect that a dog owner will be any less likely to burn your house down than anybody else. So the next time you see your neighbor walking his dog down the street and think nothing of it, check to make sure he has no lighter fluid on him. If he does, even if it is ostensibly "for the barbecue at the Anderson's", you should be afraid. Very, very afraid.

Friday, April 25, 2008

Another conversation

"Have you read... Lolita?"

"Yeah, I just love how Nabo-"

"Have you read... The Catcher in the Rye?"

"Of course! It was my favorite book in mi-"

"Have you read... The Hitchhiker's Guide to the Galaxy?"

"No."

"Oh, you should really read that book. It's very good."

Wednesday, April 23, 2008

Overconfidence bias in frisbee tossing

When I make an error and overshoot my target in any direction, it seems like a small error since both my target and the fallen frisbee are far away from me. When my partner makes an error, I am able to see precisely how far away from me the frisbee has landed.

We perceive two points far from ourselves as closer than two points near to ourselves, even if the two sets of points are both "in truth" the same distance apart.

I perceive my errors as more innocuous than they really are. I see my partner's errors, which affect me, with perfect clarity.

Can this be applied to other two agent scenarios where our actions affect others and their actions affect us? I would say so. The farther away we are from the consequences of our actions, the smaller we perceive them to be, and the more we overestimate our own abilities.

And by the way, the thought that I may be worse at frisbee than I already judge myself to be is a very scary thought. A very scary thought, indeed.

Tuesday, April 22, 2008

Tuesday Statisticz: The Dude would have voted Libertarian

"Smokey, this not 'Nam. This is bowling. There are rules." - The Big Lebowski

I've always associated bowling with Miller Lite, cigarettes, and the 50s. And when I visualize this picture, I can't help but think that everybody who goes bowling also votes Republican. It's like candy corn and carnivals. But is there really something about throwing a ball down a lane that makes you want to give your soul to the devil? Just kidding, but seriously, that's what this Tuesday Statisticz is set to find out.

I figured that the best way to do it would be to compare states. So I found the number of bowling alleys in each state (here), and the number of people that voted for Bush compared to Kerry for each state in 2004 (here). First, here's the states with the most bowling alleys per capita:


There are 4 levels here: the states with less than 1.5 bowling alleys per 100,000 people (like California) are clear, the states with 1.5 to 3 bowling alleys per 100,000 (like Maine) are grey, the states with 3 to 4.5 bowling alleys per 100,000 (like Wisconsin) are dark grey, and the state with more than 4.5 bowling alleys per 100,000 people (like North Dakota) are dark green. I know it's hard to tell the difference between dark grey and grey, but squint for me, this map was hard to make and I can't figure out how to fix it.

Next, we have the presidential voting by state in 2004. We've all seen this graph more than we've seen Jamie-Lynn Spears's boyfriend, so I tried to spice it up a little bit:


There are technically 5 levels here: dark blue states that voted more than 57% for Kerry (NY, a few other in the Northeast), light blue for states that voted between 57 and 52% for Kerry (ie, Hawaii), white for states that were "toss-ups" between 48-52%, darker red for states that voted more than 52% for Bush (like Florida), and light red for states that went predominantly for Bush (like Texas). I know that it is hard to tell the difference between dark blue and light blue, but I wanted somehow to differentiate between states that really went for a candidate and states where the populace didn't have a serious preference.

Looking at the maps, do you think that there is a correlation? Think of your answer now, I don't want any hindsight bias on my conscience.

Here's the scatterplot for votes versus bowling alleys, along with a best fit line:

It's tempting to look at the r squared value and assume that there is a pretty good correlation. But we can do better than that, and use an actual measure of significance. I found that the result was indeed significant (p < .01, t = 3, two tails, df = 48). The effect size at 0.148 isn't humongous, but it is almost certainly nonrandom. The amount of bowling alleys per capita in a state does account for a positive correlation with the number of people that will vote Republican in that state.

There are a lot of different possible third variables that could be at play here, including average temperature (notice how the bowling alleys are mostly in the North?) and distance from a major ocean (where there may be other distractions). But somebody else will have to do those regressions. I'm off to drink a White Russian.

(Thanks to Andy Eggers for providing the R code for these maps.)