Question: b . If we cut and paste most of the above code back into an editing window and change all 2 0 ' s to

b. If we cut and paste most of the above code back into an editing window and change all 20's to 30's we get the following code:
samples_of_30-c()
for in c(1:5000)
x-sum(sample(population,30))/30
samples_of_30-c(samples_of_30,x)
}
barplot(table(samples_of_30))
We can produce samples of any size by cutting, pasting and manually changing sample sizes. However, this method will be cumbersome if we want to explore many different sample sizes.
Write a function that will draw 5,000 samples of size n from the population defined above, compute the mean of each sample and make a barplot of the distribution of means.
 b. If we cut and paste most of the above code

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 Databases Questions!