平均改善幅度的估計
現在你要估計泳池水流效應的大小。請計算高號碼泳道相較於低號碼泳道的分數改善平均幅度,並同時給出此平均值的 95% 信賴區間。
本練習屬於課程
統計思維個案研究
練習說明
- 使用
np.mean()計算分數差的平均值。上個練習中的變數f已經在你的命名空間中。 - 使用
dcst.draw_bs_reps()對分數差的平均值進行 10,000 次自助法重抽,將結果存成名為bs_reps的numpy陣列。 - 使用
np.percentile()計算 95% 信賴區間。 - 按下「Submit Answer」把分數改善的平均值與 95% 信賴區間印出到畫面上。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Compute the mean difference: f_mean
f_mean = ____
# Draw 10,000 bootstrap replicates: bs_reps
bs_reps = ____
# Compute 95% confidence interval: conf_int
conf_int = ____
# Print the result
print("""
mean frac. diff.: {0:.5f}
95% conf int of mean frac. diff.: [{1:.5f}, {2:.5f}]""".format(f_mean, *conf_int))