Question
Solve using R In statistics (and data analysis) it is a common operation to standardize a vector of numbers by subtracting their mean (mean()) and
Solve using R
In statistics (and data analysis) it is a common operation to standardize a vector of numbers by subtracting their mean (mean()) and then dividing by the standard deviation (sd()).
Standardize the entries of the column carat of the diamonds data frame and save the result as a variable named caratz in your global environment. Compare this vector with scale(diamonds$carat) by making a scatter plot of this vector against caratz.
What are the arguments of scale()? How can you use the function scale() to center a vector by subtracting its mean only? How do you divide by its SD only?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started