In this project I wanted to find the top ten gender neutral baby names from three decades. I wanted to look at the 80s, 90s, and 00s. To do this the data was filtered to show the top ten baby names from the whole data set. These ten names were then plotted to see how popular they were in each decade.
First we need to load the data.
library(babynames)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
First I want to look at the most popular gender neutral names from all three decades together. This is done by taking the data from the babynames package and filtering it to show names that are recorded for both males and females. When we do this names that are not inherintly gender neutral are the most popular. To make the data more relevant to the project the data is then filtered again to show only names that are represented for both males and females but also appear over 1000 times for both. This gives us a better idea of the popular gender neutral names.
neutral_names <- babynames %>%filter(year >1979& year <2010) |>select(-prop) %>%spread(key = sex, value = n, fill =0) %>%mutate(prop_F =100* F / (F + M), se = (50- prop_F)^2) |>group_by(name) %>%summarise(n =n(), female =sum(F), male =sum(M), total =sum(F + M),mse =mean(se)) %>%filter(total >1000) %>%arrange(-desc(mse) )neutral_names|>arrange(desc(-mse)) |>head(10) -> top_ten
Once the data is filtered we can then graph it to show how the top ten gender neutral baby names. The graph is split by gender to see how popular each neutral name is for each gender. This is showing the top ten most popular gender neutral baby names from 1980 to 2010.
The data is then split by decade. The new data sets created first break down all the gender neutral names for the entire decade and then takes the top ten names.
neutral_names80s <- babynames %>%filter(year >1979& year <1990) |>select(-prop) %>%spread(key = sex, value = n, fill =0) %>%mutate(prop_F =100* F / (F + M), se = (50- prop_F)^2) |>group_by(name) %>%summarise(n =n(), female =sum(F), male =sum(M), total =sum(F + M),mse =mean(se)) %>%filter(total >1000) %>%arrange(-desc(mse) )neutral_names80s |>arrange(desc(-mse)) |>head(10) -> top_ten_80s
This is graphing the data for the top ten gender neutral names from 1980 to 1989.
From these visualizations we can see the most popular gender neutral baby names from the years 1980 to 2010. We can also see the visualizations for the top ten most popular baby names for three decades the 80s, 90s, and 00s.