Exercise

Converting a distribution to Z-scale

In this exercise, you will convert the ratings for the Australian red wine to the Z-scale. The data are already loaded into your workspace as ratings_australia.

R provides you with an easy way to do this. Given a list of observations, you can transform these observations to Z-scores using the scale() function.

Instructions

100 XP
  • Convert the ratings stored in ratings_australia to Z-scores and assign the result to z_scores_australia.
  • Plot the histograms for the original ratings and the Z-scores next to each other. The command par(mfrow = c(1, 2)) tells R to show your graphics in a matrix with 1 row and 2 columns, or side-by-side. As always, make sure that your histograms have sensible titles and clear axis labels.