View Single Post
Old 07-23-2006, 09:42 AM   #20 (permalink)
Seviien
All Star Reserve
 
Join Date: Mar 2004
Posts: 917
Thanked 10x in 9 posts
Um...
I'm sure there's an easier way, but I first did a data dump to csv files. Then I looked at players.csv and the carrer batting and pitching files. I imported players.csv into Excel and did a text-to-columns to distill the players' date of bith to just the year.

I imported the batting and pitching files into separate tables in MS Access. I then filtered out all the unwanted splits and the minor league data before exporting to text files. Those text files were then imported into Excel. Using playerID as a unique key, I used the "vlookup" function to interject the year of birth data into the career batting and career pitching worksheets. I then subtracted year of birth from the season year for a given stat line. Then it was just a matter of creating a pivot table, plopping age into the data field, changing the view option from "sum" to "average," and finally filtering out the seasons I didn't want to look at.

Like I said... I'm sure there was an easier and more direct way. The main issues are that (1) player age in current season is not included in the career batting and pitching files and (2) after 25 seasons, the career batting and pitching files were so large as to choke excel if they were imported directly without filtering unnecessary rows in Access.

Last edited by Seviien; 07-25-2006 at 08:13 PM.
Seviien is offline   Reply With Quote