I had a homework assignment asking us to code some basic things in R. Here are the tasks:

  1. Generate a Gamma(1,2) population of size N=5000 and show its density plot and descriptive statistics.
  2. Create the sampling distribution of the sample mean from 200 samples, each of size n=35, drawn from the above population.
  3. Show a density plot and descriptive statistics for this sampling distribution

I have already done the coding. But for the last question it asks, "Are your results in agreement with the central limit theorem (CLT)? Did you expect that?"

What should I be looking for exactly? I guess I don't fully understand the central limit theorem so I'm not really sure how to connect it to my results.


1 Answer 1


Let $X_i$ be the result of sampling from your gamma distribution on the $i$'th trial. Let $Y_i:=(X_i-\mu_i)/\sigma_i$, where $\mu_i=E[X_i]=E[X_1]$ and $\sigma_i$ is the standard deviation of $X_i$, both of which you know from the parameters of the gamma distribution.The central limit theorem says that

$$\frac{Y_1+\cdots+Y_n}{\sqrt{n}}\Rightarrow N(0,1).$$

In other words, if you define:


and then repeatedly sample $Z_n$ for some large $n$ (say, n=100), then the histogram (density plot) of $Z_n$'s should look roughly like a standard normal distribution. The larger $n$ is, the more accurate it should look.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.