Minimum wage by region
Looking at summary statistics of grouped data is a great way to learn about potential differences and similarities between the groups. Combine it with the @chain macro and you have nicely readable code!
In this exercise, you'll revisit the US minimum wage trends. As the 50 states plus Washington, D.C., is too much, you will look at the four regions of the United States - Northeast, Midwest, South, and West. The dataset has been loaded as wages.
Let's see how the different regions handle the minimum wage!
DataFrames, Statistics, Chain, and Plots packages have been loaded for you with the using keyword.
Este exercício faz parte do curso
Data Manipulation in Julia
Instruções do exercício
- Create a chain macro on the
wagesDataFrame and save the result asregions_wage. - Inside the macro, group by
regionandyearcolumns. - Calculate the median of
effective_min_wage_2020_dollarsand name the columnmedian_effective_wage_2020. - Unstack the result so that the rows correspond to years, columns to regions, and values to the median wage.
Exercício interativo prático
Experimente este exercício completando este código de exemplo.
# Create the chain macro
regions_wage = ____
# Group by region and year
groupby(____)
# Calculate the median wage per region per year
combine(____)
# Reshape the result
____
end
make_plot(regions_wage)