University of Minnesota, Twin Cities School of Statistics Stat 5101 Rweb
If we have a random sample of size n from a normally distributed population, we know the sampling distribution of the sample mean is exactly normal with
E(sample mean) = population meanand
sd(sample mean) = (population standard deviation) / sqrt(n)
The simulation below makes a random sample of size n from a normal population and calculates the sample mean. It does this repeatedly nsim times, thus obtaining a random sample from the sampling distribution of the sample mean. The histogram of sample mean values is plotted with a superimposed normal density curve that is the theoretical sampling distribution of the sample mean.
If we have a random sample of size n from a non-normally distributed population, we know the sampling distribution of the sample mean is not exactly normal, only approximately normal for large sample sizes, but we do know the mean and sd are exactly
E(sample mean) = population meanand
sd(sample mean) = (population standard deviation) / sqrt(n)
The simulation below makes a random sample of size n from a gamma population and calculates the sample mean. It does this repeatedly nsim times, thus obtaining a random sample from the sampling distribution of the sample mean. The histogram of sample mean values is plotted with a superimposed non-normal density curve that is the theoretical sampling distribution of the sample mean and the normal density curve (red) that is the approximately sampling distribution for large sample sizes. For comparison, the population density is shown in another plot.
alpha
of the gamma distribution
we are taking as the population distribution in this example, you change the
skewness of the population. The default alpha
= 1 is an
exponential distribution.
lambda
of the gamma distribution,
none of the shapes in either of the plots changes. Why?
If we have a random sample of size n from a non-normally distributed population, we know the sampling distribution of the sample mean is not exactly normal, only approximately normal for large sample sizes, but we do know the mean and sd are exactly
E(sample mean) = population meanand
sd(sample mean) = (population standard deviation) / sqrt(n)
The simulation below makes a random sample of size n from a bimodal skewed population and calculates the sample mean. It does this repeatedly nsim times, thus obtaining a random sample from the sampling distribution of the sample mean. The histogram of sample mean values is plotted with a superimposed non-normal density curve that is the theoretical sampling distribution of the sample mean and the normal density curve (red) that is the approximately sampling distribution for large sample sizes.
mu
to any number between zero and one,
you make the population distribution more or less skewed.
mu <- 1 / 2
makes a symmetric bimodal population.
sigma.normal
to any positive number,
you make the width of the peaks of the population wider or narrower.