10.2 Data challenge: Working hours
This data challenge focuses on the working hours data set from Our World in Data. This data set lists the annual working hours per worker per year and country.
Load the data set into R using the command
work <- read.csv(url("https://runifr.netlify.app/web/annual-working-hours-per-worker.csv"))
Get familiar with the data set: What are the dimensions? What are the columns names?
Extract all rows that correspond to the years 2010 - 2017. Plot the annual working hours of these years as 1) a histogram and 2) as a kernel density plot.
Add two vertical lines: one that corresponds to the mean working hours of Switzerland in 2010-2017 and one that corresponds to your own annual working hours. Use different colors and/or line types.
Calculate the mean and standard deviation of working hours across all countries and years 2010-2017. Add a line to your plot that represents the density of the normal distribution with this mean and standard deviation.
Assuming your data follows this normal distribution: What is the probability to accomplish less or equal working hours than your working hours?