Write a program in (mathrm{R}) that simulates 100 samples of size (n) from distributions that are specified
Question:
Write a program in \(\mathrm{R}\) that simulates 100 samples of size \(n\) from distributions that are specified below. Let \(T(F)\) correspond to the quantile functional so that \(T(F)=F^{-1}(\alpha)\) where \(\alpha \in(0,1)\) is a specified constant. For each sample compute \(\hat{\theta}_{n}=T(\hat{F})\) where \(\hat{F}\) corresponds to the empirical distribution function, and again where \(\hat{F}\) corresponds to a NORmAL distribution with mean equal to the sample mean, and variance equal to the sample variance. Construct a scatterplot of the pairs of estimated quantiles and overlay a line on the plot that corresponds to the true value of the population quantile in each case. Repeat these calculations for \(\alpha=0.05,0.10\), \(0.25,0.50,0.75,0.90\), and 0.95, and for \(n=10,25,50\) and 100. Describe the behavior found in each of these plots and discuss how the assumption of NORmALITY affects the performance of the estimator based on the NORMAL distribution.
Step by Step Answer: