1. Math
  2. Statistics And Probability
  3. r2 the goal in this problem is to create something...

Question: r2 the goal in this problem is to create something...

Question details

R2. The goal in this problem is to create something called a P-P plot (youll need the result from R1 at a key place). Heres the idea: We start by choosing (say) 100 values for q evenly spaced between 0 and 10 (qvals). We also generate (say) 100000 random numbers from what R claims is an exponential distribution with (say) λ-1/2. Using a for loop, for each value of q, we calculate what percentage of numbers from the exponential distribution we expect to be less than q (see R1), and also, what percentage of numbers from our list of 100000 that actually are less than q. After doing all this, we plot the 100 expected percentages against the 100 actual percentages Think about what graph we should get before you complete the code and then run the below code. Include a rough sketch of your plot and explain why it is shaped the way it is. 1 set.seed (3.1415) # bring our random nesses into alignment # how many values for q 3 ngs 4 lambda = 1/2 6 expectedpercentages - 7 actualpercentages 8 nnums - 9 nums # use seq function to help you # set up vector for expected values # set up vector for actual values # how many random numbers to create # make the random nums 10 11 for i in 1:nqs) 12 expectedpercentages[i]- 13 actualpercentagesi] 14 15 16 plot

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution