Question: Show all R code and output. Exercise 2. Bootstrap a variance estimate for the sample mean of the binomial distribution with p n 50 by

Show all R code and output.
Exercise 2. Bootstrap a variance estimate for the sample mean of the binomial distribution with p n 50 by coding up an algorithm with the following steps .2 and sample size Algorithm 2 Use 40,000 Bootstrapped Means to Estimate Variance of the Mean 1: Initialize a vector to store 40,000 bootstrapped means 2: Generate random sample of size n = 50 for the binomial distribution with p = .2 3: for all 40,000 repetitions do 4: Resample n50 with replacement from the vector in Step 2 5: Take the average over the 50 sampled values. 6: Store the average into your vector from Step 1 7: end for 8: Calculate the variance of 40,000 bootstrapped means a. Report the variance from Step 8 and consider the theoretical variance you got in Exercise 1-I-b for n- 50. Is your bootstrapped estimator for the variance on the right scale? (That is, if the theoretical variance is somewhere in 1-2, is the boostrapped variance also somewhere in 1-2?) b. If you actually could compute the theoretical variance, as you can for a sample mean of a binomial distribution, would you prefer to bootstrap an estimated variance for that mean as we did here or calculate the theoretical variance as we did in Exercise 1? Why? (Think about computational cost and accuracy One more R function you'll need (you've already used it before but make sure "replace" is set to true) sample(
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
