Question: Write a program in (mathrm{R}) that generates a sample from a population with distribution function [F(x)= begin{cases}0 & x

Write a program in \(\mathrm{R}\) that generates a sample from a population with distribution function

\[F(x)= \begin{cases}0 & x<-1 \\ 1+x & -1 \leq x<-\frac{1}{2} \\ \frac{1}{2} & -\frac{1}{2} \leq x<\frac{1}{2} \\ 1-x & \frac{1}{2} \leq x<1 \\ 1 & x \geq 1\end{cases}\]

This distribution is UnIForm on the set \(\left[-1,-\frac{1}{2}ight] \cup\left[\frac{1}{2}, 1ight]\). Use this program to generate samples of size \(n=5,10,25,50,100,500\), and 1000 . For each sample compute the sample median \(\hat{\xi}_{0.5}\). Repeat this process five times and plot the results on a single set of axes. What effect does the flat area of the distribution have on the convergence of the sample median? For comparison, repeat the entire experiment but compute \(\hat{\xi}_{0.75}\) instead.

Step by Step Solution

3.42 Rating (155 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Introduction To Statistical Investigations Questions!