# Thread: Proving Central Limit Theorem using Simulation

1. ## Proving Central Limit Theorem using Simulation

Hello

The CLT says that as the sample size increases, the sample becomes normal, regardless of the underlying distribution.

I would like to show that the above result is true using simulation. I know how to generate random values for various distributions in both R and SAS, but not sure what to do next.

Any help would be greately appreciated.

2. you can transform U(0,1) to various distributions and then apply the CLT.

3. Originally Posted by statmajor
Hello

The CLT says that as the sample size increases, the sample becomes normal, regardless of the underlying distribution.
The sample mean becomes normal.

Here's some R-Code.

betasim <- function(n, reps = 1000){
samplemeans <- vector(length = reps)
for(i in 1:reps){
samplemeans[i] <- mean(rbeta(n, 1/2, 1/2))
}
hist(samplemeans)
}

Then you can mess with the sample size, n, and check out the convergence to the normal for the Beta(1/2, 1/2) distribution.