oldoc63 / learningDS

Learning DS with Codecademy and Books
0 stars 0 forks source link

Sampling Distributions #434

Open oldoc63 opened 1 year ago

oldoc63 commented 1 year ago

As we saw in the last example, each time we sample from a population, we still get a slightly different sample mean. In order to understand how much variation we can expect in those sample means, we can do the following:

This process gives us an estimate of the sampling distribution of the mean for a sample size of 50 fish.

oldoc63 commented 1 year ago

Note that we can look at a sampling distribution for any statistic. For example, we could estimate the sampling distribution of the maximum by calculating the maximum of each sample, rather than the mean (as shown above).

oldoc63 commented 1 year ago

Let's estimate the sampling distribution of the mean using a population of cod fish. As we did with salmon fish, we will pretend we are all-knowing and have captured weight data on every cod fish in the ocean.

We've set the sample size equal to 50 and created a for loop to take 500 random samples.