Wednesday, February 22, 2012










  geom_point() +
      color="Yankees", colour=adjusted.yankees.frame$Result, 
      shape=adjusted.yankees.frame$Result), size=5) +
      color="Yankees"), size=1.1) +
  xlab("Year") +
    legend.title = theme_blank(),
    panel.background = theme_blank()) +
  scale_y_continuous(formatter = mysep)



  1. Thanks Patrick. Your points were well made. If possible, a graph on the following question would be a good follow-up:

    "What is the Yankee's winning percentage in relationship to the age of players on the the team?"

  2. Nicely done (and thanks for the ggplot2 code). You mentioned an r^2=0.214. My estimate came out considerably smaller; probably as a result of an error on my part. I'm a bit new at rooting around the baseball data so it's likely I missed something. REC= W/(W+L) from team table right? (FWIW - My salaries seemed to match as close as could be expected so I must be on the right track.)

    1. Hi, Robbie.

      Yep, winning percentage is: wins/(wins+losses). What method did you use to calculate it? And is your range of data the same as mine? At any rate, I double checked and yep, it's 0.214. In R, you can use the 'lm' function to get your r^2 value.

  3. Hi, Sgt. Pepper.

    A full analysis of Major League Baseball and age (not to mention weight/height) would really be needed to explore this topic fully. That being said, I put together a couple of charts:

    Yankees Age and Winning Percentage

    There is a wide confidence band for the above graph and the model is not valid for ages past 35. I wouldn't use it to make any predictions.

    Yankees Age and End Result

    This one is more interesting because you can see the range of ages on the team and what their year-end result was. Again, no real correlation that I can see, but it's obvious they were trying to keep the same team together after their world series run (the average age goes up by about one for the next couple of years).


Stylify Your Blog