平均數差異的 t 檢定
你是一家電商公司的資料科學家,負責協助付款團隊挑選能提升訂單金額並加快購買決策的結帳頁設計。
在估計所需樣本數並通過所有 sanity checks 之後,你將分析各個 checkout_page 版本之間的平均 order_value 與 time_on_page 差異,來判斷哪個設計表現最好。
checkout DataFrame 已可使用,且已為你載入 pingouin、pandas 與 numpy。
order_value 中的 NaN 代表使用者未完成購買。你將只針對已完成訂單(完整資料)分析平均訂單金額。
本練習屬於課程
Python 的 A/B 測試
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Calculate the mean order values and run a t-test between variants A and B
print(checkout.____('checkout_page')['____'].____())
ttest = ____.____(x=checkout[checkout['checkout_page']=='____']['____'],
y=checkout[checkout['checkout_page']=='____']['____'],
paired=____,
alternative="____")
print(ttest)