![]() T heoretically the mean of the sampling distribution should be 5.3. #standard deviation of sampling distribution The following code shows how to calculate the mean and standard deviation of the sampling distribution: #mean of sampling distribution We can see that the sampling distribution is bell-shaped with a peak near the value 5.įrom the tails of the distribution, however, we can see that some samples had means greater than 10 and some had means less than 0. Hist(sample_means, main = "", xlab = " Sample Means", col = " steelblue") The following code shows how to create a simple histogram to visualize the sampling distribution: #create histogram to visualize the sampling distribution We can see that the first sample had a mean of 5.283992, the second sample had a mean of 6.304845, and so on. In this example we used the rnorm() function to calculate the mean of 10,000 samples in which each sample size was 20 and was generated from a normal distribution with a mean of 5.3 and standard deviation of 9. The following code shows how to generate a sampling distribution in R: #make this example reproducible
0 Comments
Leave a Reply. |