1. Learn
  2. /
  3. Courses
  4. /
  5. Sampling in Python

Connected

Exercise

Compare sampling and bootstrap standard deviations

In the same way that you looked at how the sampling distribution and bootstrap distribution could be used to estimate the population mean, you'll now take a look at how they can be used to estimate variation, or more specifically, the standard deviation, in the population.

Recall that the sample size is 5000.

spotify_population, spotify_sample, sampling_distribution, and bootstrap_distribution are available; pandas and numpy are loaded with their usual aliases.

Instructions 1/2

undefined XP
    1
    2

Calculate the standard deviation of popularity in 4 ways.

  • Population: from spotify_population, take the standard deviation of popularity.
  • Original sample: from spotify_sample, take the standard deviation of popularity.
  • Sampling distribution: from sampling_distribution, take its standard deviation and multiply by the square root of the sample size (5000).
  • Bootstrap distribution: from bootstrap_distribution, take its standard deviation and multiply by the square root of the sample size.