(Please answer this question accuratelly THANKS)
The following commands in R computes 5000 simulations of samplemeans of size 12 from a normal distribution with mean µ = 100 andstandard deviation ? = 14. require
(fastR2) nsamplesum <- do(5000) *c(sample.mean=mean(rnorm(12,100,14)))
The following commands compute the approximate mean and standarddeviation of the sample mean and plot the histogram giving theapproximate distribution of the sample mean.
mean(? sample.mean, data=nsamplesum) sd(? sample.mean,data=nsamplesum) gf dhistogram(? sample.mean, data= nsamplesum,bins=20)
(a) Compare the approximate values of mean and standarddeviation of the sample mean found above with the expectedtheoretical ones.
(b) Repeat the same simulation as above using now samples from auniform distribution in the interval [?2, 4]. Also in this case,run a numerical test over 5000 simulations, compute mean andstandard deviation of the sample mean, and compare it to thetheoretical result.