Question: Run the code block below. Discuss the differences between the histograms of ` x ` , ` y ` , and ` z ` .

Run the code block below. Discuss the differences between the histograms of `x`,`y`, and `z`. How do they help us understand the Central Limit Theorem?
```{r}
# Run this code block
# For replicability
set.seed(2123)
# Draw 5,000 random observations out of a uniform distribution from 0-1,000
x <- runif(5000, min =0, max =1000)
# Take a sample of size 30 from x
y <- sample(x,30)
# Run a simulation:
samples <-2000
sample_size <-30
z <- vector(length = samples)
for(i in seq_along(z)){
z[i]<- mean(sample(x, sample_size, replace = TRUE))
}
# Create histograms of x, y, and z
hist(x, freq = FALSE, xlab ="")
hist(y, freq = FALSE, xlab ="")
hist(z, freq = FALSE, xlab ="")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!