Birth Month by Gender

July 16, 2016

(This article was first published on R – Exegetic Analytics, and kindly contributed to R-bloggers)

Based on some feedback to a previous post I normalised the birth counts by the (average) number of days in each month. As pointed out by a reader, the results indicate a gradual increase in the number of conceptions during (northern hemisphere) Autumn and Winter, roughly up to the end of December. Normalising the data to give births per day also shifts the peak from August to September.


> library(lifespan)
> month.days <- data.frame(
+   month =,
+   days = c(31, 28.25, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
+ )
> group_by(births, month) %>% summarise(count = sum(count)) %>%
+   merge(month.days) %>%
+   mutate(perday = count / days) %>%
+   ggplot(aes(x = month, y = perday / 1000)) +
+   geom_bar(stat = "identity", fill = "#39A75E") +
+   labs(x = "", y = "Total Births per Day [thousands]") +
+   theme_classic()

I also broke the births data down by gender. The August peak persists for both genders but female births exhibit consistently higher variability that male births. For that I have no plausible explanation. Suggestions?


> group_by(births, year, month, sex) %>% summarise(count = sum(count)) %>%
+   merge(month.days) %>%
+   mutate(perday = count / days) %>% ggplot() +
+   geom_boxplot(aes(x = month, y = perday, fill = sex)) +
+   labs(x = "", y = "Births per Day") +
+   theme_classic() + theme(legend.title = element_blank())

To leave a comment for the author, please follow the link and comment on their blog: R – Exegetic Analytics. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)