Explore the properties of the sample average using a simulated dataset from a non-normal distribution.
rgamma
or rpois
function).set.seed(123)
n <- 100
simulated_data <- rgamma(n, shape = 2, rate = 1)
Calculate the sample average of the dataset using R.
Discuss how to evaluate if the sample average is a good approximation of the true mean.(Hint: As the sample size increases, check if the sample mean converges to the true mean. Discuss the Law of Large Numbers, which states that as the sample size increases, the sample mean approaches the true mean of the population.)
If we want to find out the variance of the sample average, what should we do?
Explore the sampling distribution of the sample average.