R code:
N=1000
n=10
me=1:1000*0
sigma=1:1000*0
for(i in 1:N)
{
x=rnorm(n)
me[i]=median(x)
}
round(mean(me),4)
var(me)
round((1/(n*var(me)))*100,2)
Estimate of
=sample median=-0.0040 with efficiency=66.97%.
1b.
R code:
N=1000
n=10
Q=1:1000*0
sigma=1:1000*0
for(i in 1:N)
{
x=rnorm(n)
Q[i]=IQR(x)
}
round(mean(Q),4)
var(Q)
round((1/(2*n*var(Q)))*100,2)
Here Q=1.1564 with efficiency=28.61%.
must be Rstudio code. can use other languages to do the problem but please convert to...