Hypothesis: I predict that the frequency of patriotic baby names will increase after significant events in US history.
First, I will install the necessary packages.
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ readr 2.1.5
✔ forcats 1.0.0 ✔ stringr 1.5.1
✔ ggplot2 3.4.4 ✔ tibble 3.2.1
✔ lubridate 1.9.3 ✔ tidyr 1.3.1
✔ purrr 1.0.2
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(babynames)
I have chosen names that are undeniably “Patriotic”; Hope, Justice, Liberty, Freedom, Honor, Glory, Mercy, America, and Faith.
I will plot these names on a graph based on their frequency by year.
babynames %>%filter(name %in%c("Hope", "Justice", "Liberty", "Freedom", "Honor", "Glory", "Mercy", "America", "Faith")) %>%ggplot(aes(year, n, color = name)) +geom_line() +theme_classic() +labs(x ="year", y ="proportion", title ="Frequency of Patriotic Names from 1880-2017")
The frequency of patriotic names drastically increases beginning in the late 1990s, and remains consistently high into the rest of the 2000s.
Now, I will filter the names by gender. First, I will focus on male names.
babynames %>%filter(name %in%c("Hope", "Justice", "Liberty", "Freedom", "Honor", "Glory", "Mercy", "America", "Faith")) %>%filter(sex =="M") %>%ggplot(aes(year, n, color = name)) +geom_line() +theme_classic() +labs(x ="year", y ="proportion", title ="Frequency of Male Patriotic Names from 1880-2017")
“Justice” is significantly the most popular male name. I will remove this name from the data to better understand the trend of the other male names.
babynames %>%filter(name %in%c("Hope", "Liberty", "Freedom", "Honor", "Glory", "Mercy", "America", "Faith")) %>%filter(sex =="M") %>%ggplot(aes(year, n, color = name)) +geom_line() +theme_classic() +labs(x ="year", y ="proportion", title ="Frequency of Male Patriotic Names from 1880-2017")
Male names do not show a significant trend during any particular time periods. Although the names tend to be more popular post-1960s, the relative proportion is only ~25, which is quite inconsiderable.
Now, I am going to filter specifically for female patriotic names.
babynames %>%filter(name %in%c("Hope", "Justice", "Liberty", "Freedom", "Honor", "Glory", "Mercy", "America", "Faith")) %>%filter(sex =="F") %>%ggplot(aes(year, n, color = name)) +geom_line() +theme_classic() +labs(x ="year", y ="proportion", title ="Frequency of Female Patriotic Names from 1880-2017")
Female names tend to follow a more substantial trend over time. They also lend themselves to be much more popular than male names, with the proportion reaching ~6000, as opposed to ~100 for male names.
Since Faith and Hope are the most significant female names, I will remove them from the data set.
babynames %>%filter(name %in%c( "Justice", "Liberty", "Freedom", "Honor", "Glory", "Mercy", "America")) %>%filter(sex =="F") %>%ggplot(aes(year, n, color = name)) +geom_line() +theme_classic() +labs(x ="year", y ="proportion", title ="Frequency of Female Patriotic Names from 1880-2017")
Overall, female names had much more variation in general than male names did.
I will now examine baby names during major moments in U.S. history. I will first investigate name trends during the WW1 era, including both male and female names. I chose to use a 10 year time period in order to hone in on any potential trends. For these purposes, I will still include the most popular names of each sex. World War 1 began in 1914, and ended in 1918, so I am investigating WW1 as the years 1910-1920.
options(scipen=1000)babynames %>%filter(name %in%c("Hope", "Justice", "Liberty", "Freedom", "Honor", "Glory", "Mercy", "America", "Faith")) %>%filter(year >1910) %>%filter(year <1920) %>%ggplot(aes(year, prop, color = name)) +geom_line() +theme_classic() +labs(x ="year", y ="proportion", title ="Frequency of Patriotic Names Around World War 1") +facet_wrap(~sex)
Female names during the WW1 era showed a slight trend upwards. Male names did not show any trends.
Next, I will analyze names during the WW2 period, between 1940 and 1950.
babynames %>%filter(name %in%c("Hope", "Justice", "Liberty", "Freedom", "Honor", "Glory", "Mercy", "America", "Faith")) %>%filter(year >1937) %>%filter(year <1947) %>%ggplot(aes(year, prop, color = name)) +geom_line() +theme_classic() +labs(x ="year", y ="proportion", title ="Frequency of Patriotic Names Around WW2") +facet_wrap(~sex)
Female names showed a slight downwards trend, specifically with “Hope” and “Faith”. The name “Hope” declined during WW2 years, while “Faith” increased during the same years. Both names returned to their general frequency post WW2.
Some of the names, including Justice (as a female name) and America, Faith, Glory and Hope (as male names) were so insignificant that they did not appear on the graph. Male names in general did not show a pattern.
Next, I will analyze names during the 9-11 period, from the years 1995-2005.
babynames %>%filter(name %in%c("Hope", "Justice", "Liberty", "Freedom", "Honor", "Glory", "Mercy", "America", "Faith")) %>%filter(year >1995) %>%filter(year <2005) %>%ggplot(aes(year, prop, color = name)) +geom_line() +theme_classic() +labs(x ="year", y ="proportion", title ="Frequency of Patriotic Names Around 9-11") +facet_wrap(~sex)
Most female names had a visible uptick following 2001. I will once again remove “Faith” and “Hope” from the data.
babynames %>%filter(name %in%c( "Justice", "Liberty", "Freedom", "Honor", "Glory", "Mercy", "America")) %>%filter(year >1995) %>%filter(year <2005) %>%ggplot(aes(year, prop, color = name)) +geom_line() +theme_classic() +labs(x ="year", y ="proportion", title ="Frequency of Patriotic Names Around 9-11") +facet_wrap(~sex)
Directly following 9-11 (2001), there seemed to be an uptick in the popularity of most names. Justice as a female name had steadily decreased prior to 2001, and had a sudden increase between 2001-2002. “Liberty” and “America” also visibly increased in popularity for seemingly the first time, immediately after 9-11. As a male name, Justice appeared without following a significant pattern. No other male names were actually visible.
In concluding my observations, I can say that 9-11 had the greatest impact on Patriotic baby names out of the three events I analyzed. Also all three times, female names showed more of a reaction to historical events.
Male names were not as frequent in the data set, but either way showed little to no variation.
My hypotheses was somewhat supported by the data. While some names did increase in frequency after historical events, there is not enough context to understand whether or not this was caused by the individual events. The events did not have as large of an impact as I had anticipated.