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?

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter13: Structures
Section: Chapter Questions
Problem 4PP
icon
Related questions
Question

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? 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr