12.7. Baby names by stateΒΆ

In this assignment we return to a variant of the babynames data. This is the babynames by state data. This is given in 50 csv files, each of which has counts for one state for all the names recorded for the years 1910-2012.

For example:

Marks-MacBook-Pro:babyname_by_state gawron$ head AL.TXT
AL,F,1910,Mary,875
AL,F,1910,Annie,482
AL,F,1910,Willie,257
AL,F,1910,Mattie,232
AL,F,1910,Ruby,204
AL,F,1910,Ethel,197
AL,F,1910,Lillie,187
AL,F,1910,Ruth,168
AL,F,1910,Bessie,162
AL,F,1910,Elizabeth,146
AL,F,1910,Emma,145

The assignment is first to read in the babynames data to create one giant table with the following columns:

State Gender Year Name Ct

You then want to aggregate this data by state and year, compute the total number of births in each state for that year, and use that total to compute percentages for each name in that state for that year. At this point you should have a table with the following kind of info:

State Gender Year Name Percent

Example values.