Question: R programming: . Select R =1000 samples of some size n from a distribution (see below for which distributions you need to sample from) and
R programming: . SelectR=1000 samples of some sizenfrom a distribution (see below for which distributions you need to sample from) and take the means of theseRsamples.
- Plot the histogram of the sample means from the Rsamples you generated in step 1. This is theempirical sampling distribution of the means. Usefreq=FALSEin thehistcommand in R to obtain the density rather than the frequency distribution. Overlay the theoretical normal distribution on top of the histogram like we did in the class notes. The mean of that normal distribution, which you are superimposing, should be the mean of theRsample means and the standard deviation should be the standard deviation if theseRmeans.
- Print the mean and standard deviation of theRmeans for the current sample sizen.
- Start withn=2 and increasen. You can increase n from 2 to 10 and then by 10 say up to 200. Assess visually, how close the histogram of the sample means gets to the theoretical normal distribution and note whichnresulted in a satisfactory (according to you) approximation both visually as well as by closeness of the anticipated results (as determined by the CLT regarding the mean and standard deviation of the sampling distribution) to the observed simulated results. You can stop beforen=200 if you see convergence (i.e., good overlap between the histogram and the theoretical distribution) earlier thann=200.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
