In: Statistics and Probability
In R, get a sample of size n=5 from the Cauchy distribution and calculate its mean.
(mean(rcauchy(5)). Repeat this 1000 times and plot the histogram of the resulting 1000 means. Please show your R codes.
n <- 5
listofmeans <- c()
for(i in 1:1000){
}listofmeans <- c(listofmeans, mean(rcauchy(n)))
hist(listofmeans)
Create other histograms, changing the value of n to 10, 30, 100, and 500. Comment on what these graphs show in light of the Central Limit Theorem.
Histogram with n = 5,10,30,100,500 are respectively as follows
From the above graph 1st graph is left skewed, 2nd is right skewed, 3rd is almost symmetric, 4th is right skewed and 5th is left skewed.
The 3rd and onward graph with sample size 30,100,500 are approaches to normal distribution.