Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2. In this problem, we produce Q-Q plots with and without using built-in functions. (a) Generate a random sample of X ~N(5,3) with size
2. In this problem, we produce Q-Q plots with and without using built-in functions. (a) Generate a random sample of X ~N(5,3) with size n = 50. Let x, i = 1,...,n, denote the ith value of the sample. Produce a normal Q-Q plot of the sample using the qqnorm() function. Then add a reference line using the qqline() function. Does the Q-Q plot appear to be linear? (b) Generate an equidistant sequence of length n with starting and end values (2n)-1 and 1-(2n), respectively. Using the sequence values as probabilities, compute n standard normal quantiles. Let z, denote the ith value of the quantiles. (c) On the same Q-Q plot, add the points (20), 2()), where the subscript (i) indicates the ith smallest value. The points should be filled circles with black border and green background. Then add a red straight line that passes through Q and Qa of the standard normal distribution (r-axis) and the sample (y-axis). How do the added points and line compare to those in the original Q-Q plot? 2 (d) Add another reference line by noting the relationship X-5 3 P N(0, 1) between X and the standard normal distribution. Make the line blue this time. (Hint: Recall that a normal Q-Q plot is a plot of sample quantiles vs. standard normal quantiles.) (e) Generate a random sample of Y Unif(2,8) with size n = 50. Report the sample mean and variance of Y. How do they compare with those of X? What are the theoretical mean and variance of Y? (f) Produce a Q-Q plot of the X and Y samples using the qqplot() function. Does the Q-Q plot appear to be linear? (g) Reproduce the same Q-Q plot without using qqplot(). As before, use filled circles with black border and green background. What is the relevant reference line if we want to check whether the two samples are from the same distribution? Add that reference line in red.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started