Question: In this question, you are asked to write R code in the console that implements the instructions below: a. Consider your student ID. Create a
In this question, you are asked to write R code in the console that implements the instructions below:
a. Consider your student ID. Create a vector containing as entries the different digits of your student ID. E.g. if your student ID is 12345678, you are going to create a vector with entries 1, 2, 3, 4, 5, 6, 7, 8.
b. Create a scalar containing the number of values in your vector.
c. Using the vector and scalar created in parts a. and b., and using the function sum( ), calculate the mean of the values in the vector created in a. Save that mean under a new scalar variable.
d. Using the function mean(), confirm the result obtained in part c.
e. Now, using the formula of the standard deviation (see Descriptive Analytics II.pdf ), and using the vector and scalars created before, find the standard deviation of the values given in a. Note: the function that applies the square root is sqrt(), and to calculate powers simply use ^ (e.g. b<- a^2 ).
f. Using the function sd(), confirm the result obtained in part e.
USING R
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
