Monday, July 21, 2008

Introduction to Chance

Today we started the second half of the course that will deal with probability and statistical inference (the process of learning from data).

What did we learn?

1. Life is uncertain.
2. We use probability to quantify the uncertainty we see.
3. We got a little practice assigning probabilities.

We'll learn about probability through playing and analyzing simulation games. We introduced our first game Big League Baseball based on rolls of three dice. A red die represents the pitch and two dice determine the "in-play" outcome.

Tomorrow, we'll simulate Big League Baseball in the lab and we'll introduce the second game All-Star Baseball based on spinners.

Wednesday, July 16, 2008

Shoeless Joe

Today's class was dedicated to Shoeless Joe Jackson. Jackson was a great player whose career was abruptly ended by his implication in the Black Sox Scandal. He was removed from major league baseball by the commissioner due to his possible involvement in the the 1919 World Series? We really don't know what happened. But his life has inspired books and movies such as Field of Dreams.

Since Joe Jackson played at the same time as the great Ty Cobb, a natural question to ask was: Who was the better player. Since getting on base is a desirable goal of a hitter, we compared the season OBP's of Jackson and the OBP's of Cobb. We constructed back-to-back stemplots and five-number summaries. We learned that Cobb was better in getting on-base than Jackson -- on average, Cobb was about 20 points better.

We concluded by watching a portion of Field of Dreams. One of the best parts of the film is watching the ghost players of the past play a game. James Earl Jones gave one of the great speeches about baseball:

"Ray, people will come Ray. They'll come to Iowa for reasons they can't even fathom. They'll turn up your driveway not knowing for sure why they're doing it. They'll arrive at your door as innocent as children, longing for the past. ... And they'll watch the game and it'll be as if they dipped themselves in magic waters. The memories will be so thick they'll have to brush them away from their faces. People will come Ray. The one constant through all the years, Ray, has been baseball. America has rolled by like an army of steamrollers. It has been erased like a blackboard, rebuilt and erased again. But baseball has marked the time. This field, this game: it's a part of our past, Ray. It reminds of us of all that once was good and it could be again. Oh... people will come Ray. People will most definitely come."

Tuesday, July 15, 2008

Team Wins & the Best Batting Measure

Today we looked at the number of wins of a team for the 2006 and 2007 seasons. Our interest was to predict the number of 2007 wins given the number of 2006 wins. I gave you a simple prediction formula. We talked about predicted values and residuals. A good line is where the squares (the sum of squared residuals) is small. The least-squares line makes the sum of squared residuals as small as possible.

We also illustrated regression to the mean. We plotted a team's improvement (2007 wins - 2006 wins) against the 2006 wins. We saw that crummy teams in 2006 tend to show positive improvement, and good 2006 teams tend to show negative improvement. This is good news for Indians fans. They are currently having a poor season, but because of the regression effect, they likely will improve next season.

In the computer lab, we searched for the best batting measure. We looked at team data and looked at the relationship between runs scored per game and the batting measures AVG, OBP, SLG, and OPS. The best batting measure is where the squares (sum of squared residuals) is smallest -- using this criterion, the OPS measure is best.

Monday, July 14, 2008

How long is a baseball game?

Today we looked at the lengths of baseball games. Most games like football, basketball and soccer have periods or quarters of a set length. Baseball is different -- it ends after 9 innings (or 8 1/2 innings if the home team is leading in the ninth).

What did we learn?

1. Baseball games in 2007 averaged 175.5 minutes -- almost three hours. In contrast, the median length of baseball games in 1967 (40 years ago) was 150 minutes -- about 25 minutes shorter than 2007 games. I'm not sure why this is true. Is it due to the greater number of pitchers? Or perhaps due to the TV commercials?

2. To understand the reasoning for the variation in the lengths of baseball games, we looked at the relationship between TIME.OF.GAME and several predictors including number of AB, number of Hits, number of SO, and BFP (batters faced pitcher). The strongest association was between BFP and TIME.OF.GAME. In contrast, there was little association between SO and TIME.OF.GAME.

3. We can measure both the direction and strength of association with a correlation r. I described several properties of r and we got some practice matching up values of r and the corresponding scatterplots.

4. I concluded with some fundamental ideas from sabermetrics (the scientific study of baseball data). What is the best batting measure among AVG, OBP, SLG? Can we find the batting measure that is better than AVG, OBP, SLG? We'll address these questions next class.

Thursday, July 10, 2008

Mickey Mantle and Ticket Prices

Today, we started with some Mickey Mantle data. We collected the number of home runs (HR) and runs-batted-in (RBI) for all 18 seasons and constructed a scatterplot of HR and RBI. We were interested in predicting Mantle's RBI total given a number of HR. We fit a line by eye and found the equation for the line. My line was

RBI = 2 HR + 20

If Mantle gets 50 home runs one season, I would predict his runs-batted-in to be

RBI = 2(50) + 20 = 120

Then we moved over to the lab and look at the costs for attending a baseball game. What did we learn?

1. There is a lot of variation in team payrolls -- one team's payroll is about 10 times another team's payroll.

2. We (the fans) are paying for these rich teams through high ticket prices, high beer prices, high hot dog prices, etc. By comparing the ticket prices of the rich and poor teams, we found how much more it costs to attend a game of a rich team.

3. Orel Hersheiser and I have several things in common. We both grew up in the Philadelphia area and both us rooted for the Phils when we were young. (I'm still a Phillies fan, but I'm not sure about Hercheiser.) And of course, we're both connected with BGSU.

Have a good weekend.

Baseball movies

What are two of your favorite baseball movies? If there are several ones that seem popular, I'll show some excerpts from these movies during class.

Wednesday, July 9, 2008

Baseball attendance

Today we started talking about the economics of baseball. Teams make money by selling tickets, concessions, and advertising. Teams want to have fans attend games. But we saw that there is a lot of variation in the average attendance among teams. Particular teams such as the Yankees, Mets, and Red Sox get large attendances, while other teams such as the Marlins the Royals have small attendances.

Why do the average attendances between teams vary so much? I suggested a couple of possible reasons.

1. Market size. The market refers to the population of people who potentially can attend a game. The market size varies greatly among teams. Big cities such as New York, Los Angeles, and Chicago have large markets, while small cities such as Kansas City and Pittsburgh have small markets.

2. Team success. It would seem that winning teams (either in the present or in the past) would be a factor -- one would think that winning teams would draw more fans.

Today we looked at the relationship between average attendance and variables such as market size and team success. What did we learn?

1. There is a clear positive relationship between market size and average attendance. Simply, larger markets tend to draw more fans. There are some exceptions to this pattern. For example, St. Louis tends to draw many fans despite a small market. The Indians did well in drawing fans in the first years of a new ballpark.

2. There doesn't appear to be a relationship between the current winning percentage of a team and its average attendance. Maybe many of the tickets are purchased at the beginning of the season.

Next class, we'll focus on the different costs of attending a baseball game and see if these costs are related to the teams' payroll.