Session Ready
Exercise

Exploring sample size

Now we'll explore the effect of sample size on the results of statistical tests. Here, we'll be comparing the Weight of American Athletics and Swimming competitors in the athletes dataset. The boxplots show the difference between these two groups.

Boxplots of body weights of Olympic athletes from two sports

Using a defined seed and varying sample sizes, you will perform t-tests comparing the Weight of samples from both Sports. random, scipy.stats, and pandas have been loaded for you as random, stats, and pd.

Instructions 1/3
undefined XP
  • 1

    Create a random subset of 1000 samples, then use this to do and print a t-test to compare Weight between Sports.

    • 2

      Change the sample size to 200, repeat the t-test to compare Weight between Sports, and print the results.

    • 3

      Create a subset using the same seed for 50 samples; perform and print a t-test to compare Weight between Sports.