Write a program in (mathrm{R}) that simulates 1000 samples of size (n) from a distribution (F) with
Question:
Write a program in \(\mathrm{R}\) that simulates 1000 samples of size \(n\) from a distribution \(F\) with mean \(\theta\), where both \(n\) and \(F\) are specified below. For each sample compute two \(90 \%\) upper confidence limits for the mean: the first one of the form \(\bar{X}_{n}-n^{-1 / 2} \hat{\sigma}_{n} z_{0.10}\) and the second of the form \(\bar{X}_{n}-\) \(n^{-1 / 2} \hat{\sigma}_{n} t_{0.10, n-1}\), and determine whether \(\theta\) is less than the upper confidence limit for each method. Use the 1000 samples to estimate the coverage probability for each method. How do these estimated coverage probabilities compare for the two methods with relation to the theory presented in this chapter? Formally analyze your results and determine if there is a significant difference between the two methods at each sample size. Use \(n=5\), 10, 25, 50 and 100 for each of the distributions listed below.
a. \(\mathrm{N}(0,1)\)
b. \(\mathrm{T}(3)\)
c. EXPONENTIAL(1)
d. ExpOnENTiAL \((10)\)
e. \(\operatorname{LAPLaCe}(0,1)\)
f. \(\operatorname{Uniform}(0,1)\)
Step by Step Answer: