Question: Code in R NOT Python Question 3: Recall that the formula for the sample variance is Var(X)=N11i=1N(XiX)2 where Xi is the ith element of the

Code in R NOT Python

Code in R NOT Python Question 3: Recall that the formula for

Question 3: Recall that the formula for the sample variance is Var(X)=N11i=1N(XiX)2 where Xi is the ith element of the data set, X is the sample mean of the data set, and N is the number of observations. (a) Write a function SV(X) that inputs the data X and outputs the sample variance (which is a single value) of X. (b) Randomly generate 100 numbers from a normal distribution with mean 0 and variance 1 and save them in a vector Y. Apply your sample variance function to Y and print the result. (c) With the same vector Y from part b), compute eY and apply the sample variance to the resulting vector. Print the output

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!