Contributed by Jielei (Emma) Zhu. She takes the NYC Data Science Academy 12 week full time Data Science Bootcamp program from July 5th to September 22nd, 2016. This post is based on their first class project – the Exploratory Data Analysis Visualization Project, due on the 2nd week of the program. You can find the original article here.
Introduction:
How might baby names lead to narcissism?
Imagine you are walking down the street when someone calls out your name. You turn around finding a girl that looks familiar–you know you guys have met but you can’t remember where. She starts chatting with you and it is obvious that she remembers you well. But you still can’t remember where you last saw her or things that you guys talked about. She reminds you that you two met at a party two years ago. That’s helpful but you have been too many parties and have met even more people at those parties, so you are still clueless. Then she says her name is Augustine. Augustine! Of course, you think to yourself. Now everything starts to come back to you because you have met only one Augustine in your life. Now imagine the exact same scenario–same girl, same clothes, same place–only this time the girl’s name is Emma. She also says you guys met at a party two years ago. You try to think back to the dozens of Emma’s you have met and connect the name and her face to one of those parties. Clearly, you will have a much better chance of recalling where you guys met when the girl’s name is Augustine than when the girl’s name is Emma. But your memory is the same, and so is the girl. The only difference is the girl’s name. Specifically, the uniqueness of the girl’s name. The more unique, the more memorable. Now imagine you are Augustine, you notice that everybody that you have talked to throughout your life almost always remembers you, even years later. How might that make you feel? Attractive maybe? Important? However you may feel, you probably feel good about yourself, and perhaps feel more special than Emma. Over time, you may find yourself on your way to narcissism.
What is the Narcissism Epidemic?
Narcissism Epidemic is defined by Professor Twenge from University of California, Santa Barbara. According to one of Professor Twenge’s studies, college students in the 2000s reported significantly higher narcissism scores than college students in the 1980s as measured by the Narcissistic Personality Inventory[1]. Additionally, 82% of surveyed high school and college students in 2013 reported “being very well off financially” was an important life goal whereas in the early 70’s, only 45% said so. “[B]eing very well off financially” was termed an indicator of materialism by Scientist, and it was found to be correlated with narcissism. Hence, professor Twenge stated that we are experiencing a Narcissism Epidemic, where an average American is more narcissistic now than before.
What is the motivation for this visualisation project?
In connecting the dots between memorable names making us feel more narcissistic and the idea of a Narcissism Epidemic, I hypothesised that there might be an increasing trend in the number of memorable names given to babies that could have contributed to the increasing trend in our narcissism scores. In order to test my theory, I need to visualise how the number of memorable names changed over the years. However, memorableness is intangible, therefore hard to quantify. So, instead of measuring memorableness directly, I defined 3 constructs that helps me measure memorableness indirectly. The constructs are:
- Names that are shared with less people are more memorable (e.g. “Augustine” vs. “Emma”)
- Longer names are more memorable (e.g. “Michelangelo” vs. “David”)
- Names that are usually associated with the opposite gender are more memorable (e.g. a girl named “Jordan” vs. a boy named “Jordan”)
Dataset:
I collected two baby-name datasets from Kaggle.com (originally from Data.gov). The first dataset (“Baby names across U.S.”) contains all baby names across the U.S., ordered by year, gender, and the number of occurrences per year. The second dataset (“Baby names by state”) contains the same information as the first dataset with an extra attribute: state. For the purpose of this project, only names from 1914 and 2014 are considered, leaving the first dataset containing roughly 200k entries and the second dataset containing 600k entries. library(ggplot2) library(plyr) library(dplyr)
setwd('~/Desktop/DataScienceAcademy/Projects/Visualization with ggplot2')
national = read.csv('NationalNames.csv') state = read.csv('StateNames.csv')
str(national) head(national) str(state) head(state) # str(births)
range(national$Year) length(unique(national$Year)) # year goes from 1880 to 2014 # total of 135 years
start_year = 1914 end_year = 2014 selected_years = seq(start_year, end_year, 1) num_levels = (end_year - start_year)/10
In addition to baby name datasets, I collected a national population dataset from Census.gov. This dataset contains U.S. population counts for the years mentioned above (i.e. 1914 to 2014) .
Visualisation Through Hypotheses:
1. Are parents giving their babies names that are shared by few others?
To test this hypothesis, I plotted the number of names with unique spellings for each year from 1914 to 2014 (Figure 2). At first glimpse, we can see that there is a clear upward trend in the number of names with unique spellings, which may suggest that parents are giving their babies names that few others have. However, if our population has been growing at a faster rate than the number of unique names, the opposite of what I expected would be true, which is that parents are giving their babies names that are shared with more people. Therefore, we ought to examine the population data. #================================find number of unique baby names national_year = national %>% group_by(Year) %>% summarise(count=sum(Count)) range(national_year$count)
filtered_national = national %>% filter(Year>=start_year & Year<=end_year) filtered_national$bins = cut(filtered_national$Year, breaks=num_levels)
distinct_national = filtered_national %>% group_by(Year) %>% summarise(Count = n_distinct(Name)) distinct_range = max(distinct_national$Count) - min(distinct_national$Count) distinct_national$Normalized = (distinct_national$Count - min(distinct_national$Count)) / distinct_range
ggplot(distinct_national, aes(Year, Count)) + geom_line(color='red') + xlim(start_year, end_year) + ylim(0, round_any(max(distinct_national$Count), 10000, f=ceiling)) + ggtitle('Number of unique baby names')
Figure 2: The number of baby names with unique spellings for year 1914 through year 2014. As expected, the U.S. population has been increasing for the past 100 years (Figure 3). So, the question is: which trend is increasing faster? The number of unique baby names or population? #================================plot against population population = read.csv('population.csv', header=T) head(population)
population = population %>% filter(Year>=start_year & Year<=end_year)
ggplot(population, aes(Year, Change/1e6)) + geom_line(color='blue') + ylab('Population (in millions)') + ggtitle('U.S. population')
Figure 3: U.S. population from 1914 to 2014 To ensure the number of unique baby names and population data are comparable, I normalized both of them so they ranged from 0 to 1. In Figure 4, it seems the number of unique baby names increases at a faster rate than population. But how does it translate to the number of people sharing the same name? To answer this question, I plotted the ratio of population over the number of unique names. population_range = max(population$Change) - min(population$Change) population$Normalized = (population$Change - min(population$Change)) / population_range population$distinct_national = distinct_national$Normalized
ggplot(population, aes(Year)) + geom_line(aes(y=distinct_national, color='blue')) + geom_line(aes(y=Normalized, color='red')) + scale_colour_manual("", labels = c("Unique names", "Population"), values = c("red", "blue")) + ggtitle('Number of unique names against population')
Figure 4: Normalized number of unique names is plotted against normalized population from 1914 to 2014 Based on this plot (Figure 5), it is clear that fewer and fewer people are sharing the same name nowadays. In fact, the population per name in early 1970s has gone down by nearly a half by the late 2000s. #================================population per name
population_per_name = data.frame(Year = selected_years) population_per_name$Ratio = population$Change / (filtered_national %>% group_by(Year) %>% summarise(Count = n_distinct(Name)))$Count
ggplot() + geom_line(data=population_per_name, aes(Year, Ratio),color='purple') + ylab('Population per name (in thousands)') + ggtitle('Population per name') + ylim(0, round_any(max(population_per_name$Ratio), 10000, f=ceiling))
(max(population_per_name$Ratio) - min(population_per_name$Ratio)) / max(population_per_name$Ratio)
Figure 5: Population divided by the number of unique names for each year from 1914 to 2014
2. Are parents giving their babies longer names?
The previous figures show that there are more names being created every year and babies seem to share names with less and less people over the years. Now, you may wonder how those names are created. After all, there are only so many combinations of the English alphabet, and if you think of all the Indian and Chinese names that you have tried to pronounce but couldn’t, you know that some of the combinations will never get picked. So, is it possible that parents are coming up with names that have more letters? For instance, instead of “Mike”, parents choose “Michael”? And here is what the data shows: not really. The average length of baby names from 1914 to 2014 have stayed a little above 6 throughout the years (Figure 6). #================================ average length of name average_length = filtered_national %>% group_by(Year) %>% summarise(Length = mean(nchar(unique(as.character(Name)))))
ggplot(average_length, aes(Year, Length)) + geom_step() + ylim(4,8) + ggtitle('Average length of baby names')
Figure 6: Average length of baby names for year 1914 to year 2014 So we know that there are still more combinations of 6-letter names that have not been used (there are in total 24^6 possible combinations, which is about 200 million). But are there any interesting patterns or are parents coming up new names more or less randomly? After some inspections of the data, I found one pattern that stood out: remember the last time when someone introduced himself/herself to you, and you think you know how to spell the name, but the person says “but is spelled with 2 e’s” or something like that? Apparently, this is a thing–parents are giving their babies common-sounding names with uncommon spellings. To show you what I mean, here is an example from the data: You must be wondering why parents are doing this. While the exact reasons may be hard to pin down, but how about this answer : parents are trying to make their children more memorable by giving them unique-spelling names.
3. Are parents giving their babies names that are usually associated with the opposite gender?
As defined earlier, a name may be memorable because it is shared by less people, or is spelled with more letters, or is usually associated with the opposite gender. We have examined the data for the first two constructs and have found people nowadays do share names with less people, but they are not getting longer names. Now, let’s see if boys and girls nowadays share more names than they did in the past. In Figure 7, we see that it is indeed the case: the number of gender-neutral names are increasing monotonically for the past decades. #================================ number of gender-neutral names
neutral_over_year = data.frame(Year=selected_years, Count=rep(NA, length(selected_years)))
for (i in 1:length(selected_years)) { temp_f = filtered_national %>% filter(Year==as.character(selected_years[i])) %>% filter(Gender=='F') %>% select(Name, Count) temp_m = filtered_national %>% filter(Year==as.character(selected_years[i])) %>% filter(Gender=='M') %>% select(Name, Count)
neutral_over_year[i,2] = sum(is.na(match(temp_f$Name, temp_m$Name))=='FALSE')
}
ggplot(neutral_over_year, aes(Year, Count)) + geom_line() + xlim(start_year, end_year) + ylim(0, round_any(max(neutral_over_year$Count), 1000, f=ceiling)) + ggtitle('Number of gender-neutral baby names')
Figure 7: The number of different names that are given to both boys and girls for each year from 1914 to 2014
Conclusions:
After visualising the U.S. baby name dataset and the U.S. population dataset from 1914 to 2014, I found that
- Babies born in the recent years are sharing names with less people than babies born decades ago
- Babies born in 1914 got names that were on average 6-letters long. This phenomenon repeated itself for the past 100 years.
- Babies today are sharing more names with the opposite gender than babies did 100 years ago
In conclusion, parents are giving their babies more memorable names now because those names are 1) shared by less people and 2) usually associated with the opposite gender. This trend is similar to the increasing trend in our narcissism scores, suggesting a relationship between the two. In the future, I would like to obtain data on Americans’ narcissism scores, so the exact correlation between memorableness of baby names and narcissism scores can be quantified. Reference: [1]: L. M. (2014, May 16). Research says young people today are more narcissistic than ever. Retrieved July 18, 2016, from http://www.abc.net.au/radionational/programs/allinthemind/young-peo…