Exercise

Null Hypothesis

In this exercise, we formulate the null hypothesis as

short and long time durations have no effect on total distance traveled.

We interpret the "zero effect size" to mean that if we shuffled samples between short and long times, so that two new samples each have a mix of short and long duration trips, and then compute the test statistic, on average it will be zero.

In this exercise, your goal is to perform the shuffling and resampling. Start with the predefined group_duration_short and group_duration_long which are the un-shuffled time duration groups.

Instructions

100 XP
  • Use np.concatenate() to combine the two populations, and then use np.random.shuffle() to shuffle the values inside that container.
  • Slice the shuffle_bucket in half and use np.random.choice() to resample each shuffle_half.
  • Compute the test_statistic by subtracting resample_half1 from resample_half2.
  • Compute the effect_size as the np.mean() of the test_statistic, and print the result.