新菸鹼類殺蟲劑是否帶來意想不到的後果?
在進入下一章的個案研究、把所有概念串起來之前,這題作為假設檢定的最後一個練習。你將探究新菸鹼類殺蟲劑對蜜蜂繁殖的影響。這類殺蟲劑在美國非常普遍,用來對抗會危害植物的蚜蟲與其他害蟲。
在一項近期研究中,Straub 等人(Proc. Roy. Soc. B, 2016)調查了新菸鹼類藥劑對授粉蜜蜂精子的影響。在本題與下一題中,你將研究農藥處理如何影響每 0.5 毫升精液中的活精子數量。
首先,照慣例先做 EDA。請繪製未施藥蜜蜂(儲存在 NumPy 陣列 control)與施用農藥蜜蜂(儲存在 NumPy 陣列 treated)的活精子數量之 ECDF 圖。
本練習屬於課程
Statistical Thinking in Python(第 2 部分)
練習說明
- 使用你的
ecdf()函式,從control與treated陣列產生要用來繪製 ECDF 的x,y值。 - 在同一張圖上繪製兩個 ECDF。
- 邊界、圖例與座標軸標籤都已為你設定好。按下 送出答案 查看結果!
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Compute x,y values for ECDFs
x_control, y_control = ____
x_treated, y_treated = ____
# Plot the ECDFs
plt.plot(____, ____, marker='.', linestyle='none')
plt.plot(____, ____, marker='.', linestyle='none')
# Set the margins
plt.margins(0.02)
# Add a legend
plt.legend(('control', 'treated'), loc='lower right')
# Label axes and show plot
plt.xlabel('millions of alive sperm per mL')
plt.ylabel('ECDF')
plt.show()