Imagine you're working with a dataset in R and need to standardize a numeric column. How would you approach this?

  • Add the mean and multiply by the standard deviation
  • Multiply by the standard deviation and add the mean
  • Subtract the mean and divide by the standard deviation
  • Subtract the median and divide by the interquartile range
To standardize a numeric column in R, we typically subtract the mean of the column and then divide by the standard deviation. This results in a column with a mean of 0 and standard deviation of 1. This can be done using the scale() function in R.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *