Exercise 1.2
Code
Questions
- Try summarizing the data with a different function for one or more of the variables.
- What is the median value of
polyarchy
for The West? - What is the max value of
gdp_pc
for Eastern Europe? - What is the standard deviation of
flfp
for Africa? - What is the interquartile range of
women_rep
for the Middle East?
- Now try grouping by country instead of region.
- What is the median value of
polyarchy
for Sweden? - What is the max value of
gdp_pc
New Zealand? - What is the standard deviation of
flfp
for Spain? - What is the interquartile range of
women_rep
for Germany?
Sort countries in descending order based on the mean value of
gdp_pc
(instead of the median value ofpolyarchy
). Which country ranks first based on this sorting?Now try sorting countries in ascending order based on the median value of
women_rep
(hint: delete “desc” from thearrange()
call). Which country ranks at the “top” of the list?