Exercise

Calculating Z-scores

We can calculate the z-score for a given value (X) as (X - mean) / standard deviation. In R you can do this with a whole variable at once by putting the variable name in the place of X. Let's try this!

Instructions

100 XP
  • In your script, calculate the z-score of the mpg variable of the mtcars data set
  • Remember to put brackets around (X - mean)