Exercise

Effect size for a t-test

Now, we're going to have a look at effect sizes. We are examining the same slice from the athletes dataset, comparing the body weights of competitors from swimming and athletics events. The boxplots are included.

Boxplots of body weights of Olympic athletes from two sports

You're going to calculate the effect sizes we are able to detect for a couple of different sampling strategies. First, you'll determine the smallest effect size detectable using the complete dataset. Then, in Step 2, you'll determine the size effect we could detect using 300 samples from each Sport. statsmodels.stats.power and pandas have been loaded for you as pwr and pd.

Instructions 1/2

undefined XP
  • 1
    • Set parameters for entire dataset (all Athletics rows for samp_size)

    • Initialize, solve for effect size, and print.

  • 2
    • Change parameters for a sample of 300 competitors from each group.
    • Repeat effect size analysis and print result.