I downloaded the CDC Wonder data for 2006-2020 applied the transforms and cleaning that we did in class. The first plot of the data we will look at is the TS Plot of Rate for 25-29 by Mother’s Hispanic Origin and Region graph group
by_region_0320hisp %>%
filter(Age == "25-29") %>%
ggplot(aes(x= Year, y = Rate)) +
geom_point() +
facet_grid(Hisp~Region) +
ggtitle("TS Plot of Rate for 25-29 by Mother's Hispanic Origin and Region")
We also created other graphs in class such as these to analyze the data.
by_region_0320hisp %>%
filter(Age == "25-29") %>%
ggplot(aes(x= Year, y = Rate)) +
geom_point() +
facet_grid(Region~Hisp) +
ggtitle("TS Plot of Rate for 25-29 by Mother's Hispanic Origin and Region")
by_region_0320hisp %>%
group_by(Year,Hisp,Age) %>%
summarize(Births = sum(Births),
Fpop = sum(Fpop)) %>%
mutate(Rate = Births/Fpop)%>%
summarize(TFR = sum(Rate) * 5) %>%
ungroup() %>%
ggplot(aes(x = Year,y = TFR, color = Hisp)) +
geom_point()
## `summarise()` has grouped output by 'Year', 'Hisp'. You can override using the `.groups` argument.
## `summarise()` has grouped output by 'Year'. You can override using the `.groups` argument.
ggtitle("National TFR by Year and Mother's Hispanic Origin")
## $title
## [1] "National TFR by Year and Mother's Hispanic Origin"
##
## attr(,"class")
## [1] "labels"
#ggplotly(g1)
by_region_0320hisp %>%
group_by(Year,Region,Hisp,Age) %>%
summarize(Births = sum(Births),
Fpop = sum(Fpop)) %>%
mutate(Rate = Births/Fpop)%>%
summarize(TFR = sum(Rate) * 5) %>%
ungroup() %>%
ggplot(aes(x = Year,y = TFR, color = Hisp)) +
geom_point() +
facet_grid(Hisp~Region)
## `summarise()` has grouped output by 'Year', 'Region', 'Hisp'. You can override using the `.groups` argument.
## `summarise()` has grouped output by 'Year', 'Region'. You can override using the `.groups` argument.
ggtitle("Regional TFR by Year and Mother's Hispanic Origin")
## $title
## [1] "Regional TFR by Year and Mother's Hispanic Origin"
##
## attr(,"class")
## [1] "labels"
#ggplotly(g2)