Exercise

  1. Load the data “bplong”. Make yourself familiar with the dataset. Reshape the data such that you have only one row of observations per patient. Inspect the data.
  2. Load the data “bpwide”. Make yourself familiar with the dataset. Reshape the data such that each patient’s blood pressure measures are a distinct row of observation. You might need to use an option of “reshape”. Inspect the data.
  3. Load the data “lifeexp”. Generate a categorical variable which groups the observations by GNP p.c. (use the left-hand boundaries 0, 5000, 10 000, 40 0000). You would like to display the mean population growth and mean life expectancy by region (as rows) and income group (as columns). Use the “collapse”, “reshape”, and “list” command for this.