開始使用免費開始

鳥喙深度的參數估計

估計 1975 年與 2012 年的 G. scandens 樣本之鳥喙深度「平均數的差」,並回報 95% 信賴區間。

由於本練習會用到你在第 2 章撰寫的 draw_bs_reps() 函式,你可能需要回去參考一下

本練習屬於課程

Statistical Thinking in Python(第 2 部分)

檢視課程

練習說明

  • 計算兩個樣本平均數的差。
  • 使用你的 draw_bs_reps() 函式,對 1975 年的鳥喙深度取 10,000 次平均數的自助法重抽複本。對 2012 年的鳥喙深度也同樣取得 10,000 次複本。
  • 以 2012 年的複本減去 1975 年的複本,得到「平均數差」的自助法複本。
  • 使用這些複本計算 95% 信賴區間。
  • 送出以查看結果!

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Compute the difference of the sample means: mean_diff
mean_diff = ____

# Get bootstrap replicates of means
bs_replicates_1975 = ____
bs_replicates_2012 = ____

# Compute samples of difference of means: bs_diff_replicates
bs_diff_replicates = ____

# Compute 95% confidence interval: conf_int
conf_int = ____

# Print the results
print('difference of means =', mean_diff, 'mm')
print('95% confidence interval =', conf_int, 'mm')
編輯並執行程式碼