Exercise

Load the pre-installed dataset lifeexp.

  1. Aggregate the dataset to the means of population growth, life expectancy, GNP p.c., and access to safe water. List the observations.
  2. Re-load the dataset. Aggregate the dataset by region, using the minimum, median, and maximum value for GNP p.c. and creating a variable indicating how many observations per regions are used. List the observations.
  3. Re-load the dataset. Aggregate the data as in (2), and create a bar graph of the minimum, median, and maximum GNP p.c. by region. This time, make sure that the initial data is restored afterwards, such that you can display summary statistics for all variables of the initial dataset.
  4. Re-load the dataset. Generate a categorical variable which groups the observations by GNP p.c. (use the left-hand boundaries 0, 5000, 10 000, 40 0000). Aggregate the dataset by region and the new variable, using mean GNP p.c. List the observations. What do you notice?