Instructions: You are not required to use R markdown for the lab assignment. Please include ALL R commands you used to reach your answers in a word or pdf document. Also, report everything you are asked to do so
Problem 2 : Answer the following questions:
1. First run alphas <- seq(0.1, 1, by = 0.1) and nalphas <- - rev(alphas). Based on what you have seen, describe how functions seq and rev work. Then run qnorm(c(nalphas, alphas)) and report the result you get. What are they? What pattern did you notice and why?
2. Use the function rnorm to generate 10000 random numbers from N(50, 4), store those random numbers into a vector called firstrn. It is expected that the sample mean of firstrn should be close to the population mean 50. Use the function mean to verify this.
3. Suppose X ∼ Possion(2). Report the probability that P(1 < X ≤ 5). Show the code you used to reach this answer.
1. The seq function gives a increasing Arithmetic progression while the "rev" givea a reverse sequence of a vector.
The qnorm produced by nalphas are NaNs because the percentile values can't be negative.
Here is the R code:
Get Answers For Free
Most questions answered within 1 hours.