College students are usually interested in their scores on exams. The following are the scores on a statistics exam: 27, 23, 28, 38, 26, 28, 42, 50, 27, 33, 42, 44, 29, 46, 18, 28, 27, 41. We represent these as a vector x in R by making the following assignmemt: x <- c(27, 23, 28, 38, 26, 28, 42, 50, 27, 33, 42, 44, 29, 46, 18, 28, 27, 41) Define the vector y using the assignment y <- cumsum(x) Define the vector w using the assignment w <- y + 2 Define z by the assignment z <- c(x,y,w) x, y, w and z are vectors. Answer the following using R code. a) Calculate is the maximum value of z. b) Calculate the sum of the squares of the elements in z. c) Calculate the sample mean of z. d) Calculate the sample variance of z. e) Calculate the sample standard deviation of z f) What is the 6th element of y? (value of y[6]) g) Calculate the sample variance of x. h) Calculate the sample variance of 2*x i) What is the length(# of elements) of z? j) How many unique(different) values are in z?
College students are usually interested in their scores on exams. The following are the scores on a statistics exam: 27, 23, 28, 38, 26, 28, 42, 50, 27, 33, 42, 44, 29, 46, 18, 28, 27, 41. We represent these as a vector x in R by making the following assignmemt:
x <- c(27, 23, 28, 38, 26, 28, 42, 50, 27, 33, 42, 44, 29, 46, 18, 28, 27, 41)
Define the vector y using the assignment y <- cumsum(x)
Define the vector w using the assignment w <- y + 2
Define z by the assignment z <- c(x,y,w)
x, y, w and z are
a) Calculate is the maximum value of z.
b) Calculate the sum of the squares of the elements in z.
c) Calculate the sample mean of z.
d) Calculate the sample variance of z.
e) Calculate the sample standard deviation of z
f) What is the 6th element of y? (value of y[6])
g) Calculate the sample variance of x.
h) Calculate the sample variance of 2*x
i) What is the length(# of elements) of z?
j) How many unique(different) values are in z?
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images