Monday, May 24, 2010

The Songs of Stats

Have you ever listened to a song on the radio and thought 'this song reminds me of Statistics'? I know - me too! So I endeavored to spend a little time exercising the other half of my brain and, so far, I've come up with two songs I'd like to share with you. Feel free to try them out and post any thoughts, feedback, or comments. Be nice, though - I AM a math guy, after all.

Today Was the AP Test - apologies to T. Swift


Today Was The AP Test

Today was the AP test
You got a 5
I used to be a student in distress
You handed me your calc
And you picked me up at noon
Today was the AP test
Today was the AP test

Today was the AP test
I was nervous
You wore your AP stats t-shirt
You told me I was smart my page looked like a mess
Today was the AP test
Time slows down
Wherever tests are found

Can you find the z-score over there?
It must've been the way you assumed the null
Fell in love when I saw your alternate
It must've been the p
Today was the AP test
It must've been the p
Today was the AP test

Today was the AP test
You got a 5
It takes me to another Stat Plot
Every inference
Every sample mean is right
Today was the AP test

Today was the AP test
All that I could say is now it's Getting so much clearer
Nothing made sense til I gave the placebo
Today was the AP test
Time slows down
Wherever tests are found-Yeah

Can you find the z-score over there?
It must've been the way you Lin-Reg-ed me
Fell in love when I saw you squarin’ Chi
It must've been the p
Today was the AP test
It must've been the p
Today was the AP test

Time slows down
Whenever tests are found
I can feel my 84
It's beating on my desk
Did you feel it
I can't put this down

Can you find the z-score over there?
It must've been the way you found alpha
Fell in love with your BinomCDF
It must've been the p

Can you find the z-score over there
It must've been the way you sampled
Fell in love when I saw you reject the null
It must've been the p
Today was the AP test
It must've been the p
Today was the AP test

Oh Oh Ooh Yeah oh
Today was the AP test





Inference is Second to None - apologies to Boys Like Girls and T. Swift




Inference is second to none

I remember what you thought on the first day
You came into the room and took your place
Oh no, what am I doing?
Cause every claim you make and test you do
Is your error Type I or Type II?
95% confidence

Maybe it 's true
I can't reject the hypothesis
Because inference is second to none
You have plenty of time
To test and check your assumptions
If your p-value is too low, reject
I know that inference is second to none

I remember every curve you ever drew
The way you did matched pairs, not sample-2
Define your variables in context
Cause when I reject the null I have to say
My result is significant, ok
I'm now a statistician

H-a is true, I can't keep the status quo
Because inference is second to none
Don't cross that line
To figure out your p-value
What's your power against an alternate mean?
I know that inference is second to none

I think I know just what they'll try to say
You made it through stats and you're ok

1 p or 2
I can't decide, can you?
Maybe Chi square should be done
I'm so confused
To figure out significance, yeah
And I've already got my sketch drawn
And I'm thinking where is that darn mu
Cause baby inference is second to none.
There's not much time to figure out accept or reject
But I'll figure it out when it's all said and done
Inference is second to none
Inference is second to none

Sunday, May 23, 2010

A Little Peter Pan Fairy Dust

Let's get something straight. I like my peanut butter. There may be exceptions, but so far I have yet to discover any food that doesn't taste a little better with peanut butter on it. However, recently, I came across a little marketing ploy that turned me off - at least from one brand in particular.



You see, Peter Pan peanut butter is environmentally conscious. They know that producing unnecessay plastic for their jars of peanut butter is not responsible in this day and age. So they have taken reductionism to new heights - as you can see, they now sell jars that use 9% less plastic PER OUNCE.


Sounds pretty good, huh? I mean, 9% isn't much, but it's a start, right? Wait - did I read that right? They don't use less plastic per JAR, but per OUNCE. Wow- that's even better! Indulge me a bit. The small jar of peanut butter containes 16.3 ounces of peanut butter. So if they are using 9% less plastic PER OUNCE, that makes... 16.3 ... times ... 9%... carry the one... and whoa- they have actually reduced their plastic consumption by 146.7%! This is big news. Not only have they done away with 100% of the plastic they previously used, but they are now actually giving almost 50% of that previous amount BACK to the environment.



If you're confused, let's assume that originally, they used 2 ounces of plastic per jar. (I actually have no idea, but it wouldn't be that hard to weigh the jar and subtract 16.3 ounces for the product inside. 146.7% of 2 ounces is a little over 2.9 ounces. That means they actually got rid of all plastic, and now use almost NEGATIVE 1 ounce of plastic on each jar - now THAT is environmental responsibility!

What's weird is that their 28 ounce jars do even better (because there is more plastic AND peanut butter?). They have reduced that plastic consumption by 12% per ounce. That equates to a reduction of 336%. So if that 28 ounce jar previously required 5 ounces of plastic, now not only do they not use those 5 ounces, but they use an "additional" NEGATIVE 11.8 ounces. They give back more than twice what they used to use.



Peter Pan has cornered the market on packaging reduction. In fact, they have taken it to extremes...unless they really aren't doing what they say they are doing. So to find out, I wrote Peter Pan (the company, not the elf) a letter explaining my concern. And to their credit, I received a lovely form letter back telling me how much they appreciate my interest in their peanut butter and that with helpful suggestions like mine they can make their product even better. Say what? I like their product fine. I just don't like the way they market it to a green-hungry populace. I kindly replied, and explained that my concern wasn't about the quality of their product, but the ethics of their advertising. I'm still waiting for a response.



As consumers of both products and marketing, let's make sure we know what we're being sold, both inside the product and outside. Let's recognize manufacturers for the valid work they are doing to produce quality products in environmentally responsible packaging. But let's not be swayed by marketing gimmicks that play on our emotions, while falling short of mathematical accuracy. For the record, I still have plenty of peanut butter in my pantry, but not one of the jars says Peter Pan. Good thing, too. As they don't use any packaging any more, it would make a mess on the shelf.

Sunday, May 9, 2010

Are the Mariners really that bad?

Baseball prides itself on its obsession with statistics. I can't count the number of times I've heard an announcer tell me "Joe DiMaggio is hitting .376 with runners on first and third, less than 2 outs, against a left-handed pitcher from Venezuela, playing outdoors in an afternoon game after being shut out the night before by a right-hander." But statistics don't always tell the tale, I'm afraid.

Commentators love to use the phrase 'He's due' to explain why a person suffering a slump should be expected to get a hit his next time up. Let's consider an example. Consider a player, we'll call him Ichiro, with a lifetime batting average of .300. That means that over his career, he's gotten a 3 hits for every 10 times up to bat. We won't get into what constitutes an official at bat here - just assume he gets 3 hits every 10 times up. The problem is that Ichiro is mired in a slump. Here is what you could hear from an announcer:

"Ichiro steps to the plate in the middle of a 2-20 slump the past 5 games. He is due to break out of that slump and have a big night."

Ever heard that phrase before? It suggests a deep understanding of statistics and probability. And it's wrong. When Ichiro steps to the plate, he's going to do one of two things - he'll either get a hit, or he won't. Some people consider that a 50/50 proposition, but in baseball, the chances of getting a hit on a given at-bat are far worse than 50/50. Anyone who can get 3 hits in 10 tries will be a millionaire. So Ichiro, who hasn't been able to get a hit, faces two options: He continues on his streak of futility, or he manages to get a hit. The question is, which is more likely BEFORE he steps to the plate?

To understand this better, let's consider a coin-tossing experiment. In this experiment we toss a coin 10 times and count the number of heads we see. After 10 tosses, we predict the outcome of the 11th toss. Sounds easy, right? Most people would say the probability of getting a head on the 11th toss is 50%.

Now imagine tossing the coin 10 times and seeing all 10 come up heads. What do you predict now? Some people will say 'Heads' because after all, if it came up heads 10 times in a row, it probably will come up heads again. Some will say 'Tails' because "it's due". Finally others will say 'It's 50/50' because that's what coins do. Who is right here?

What we are seeing is a case of the Law of Small Numbers versus the Law of Large Numbers. One is statistically valid, the other is bogus. We are a culture that lives in the moment - what have you done lately, how many games have you won this year, what did you get on your last test? But using small numbers to make significant predictions about future events is dangerous. Small numbers (such as 10 tosses of a coin) sometimes show up with unexpected 'patterns' that cause us to believe something is not right. If you track the performance of a single stock for 4 straight days, you may see it drop each day and conclude that it's overpriced and that you shouldn't buy it. However, this little run of bad luck might be sandwiched between significant growth over time that you miss by looking at the small numbers. A bank CEO might see his bank's value drop over a couple of years after stunning growth the previous 10. Did the CEO suddenly lose the ability to lead the bank? Or is this just a hiccup on the long road of financial development?

The Law of Large Numbers accommodates small fluctuations in performance and doesn't panic. It sees strings of success and failures come and go, and only over time does a clear pattern emerge from the apparent chaos of random events. Those that invest in the stock market for the long haul tend to do better than those who buy and sell on a whim. Baseball takes 162 games to determine a winner. So, too, do statisticians wait for performance over a long period of time and a large number of trials to determine whether a situation is significant or not. And that brings me to my question:

On April 30, the Seattle Mariners were one bunt away from moving into first place in their division. It was the 11th inning, Cliff Lee had pitched a masterpiece, and all they had to do was lay down the bunt. They missed it and Ichiro was tagged out at home. They went on to lose that game. And the next. And the next. All told, they lost 8 straight games to fall well behind the pack in the AL West. So today is Mother's Day, and the question is, what are the M's chances of winning the game? If you are a Small Numbers person, you might think 'they are bound to win eventually, so I think their chances are good.' If you have already jumped off the bandwagon of fan support, you might think 'they are terrible again, and are destined to lose.' Or you might say 'they aren't that good, but they have a chance of winning this one.'

The question is, when a team suffers a long losing streak, do the chances of the team finally winning go up, go down, or stay the same?




By the way, the Mariners won today, 8-1, and are currently 12-19, 5 1/2 games out of first place.

Friday, May 7, 2010

ChAPS 2011!

Get ready for the ride of your life! Check back here often for updates on Stats for 2011. And prepare yourself for the FUN Summer (extra credit) assignment!!