開始使用免費開始

單一比例的檢定

在第 1 章中,你曾為一個假設進行 p 值計算:延遲出貨的比例大於 6%。當時你用自助法(bootstrap)分佈來估計統計量的標準誤。另一個更簡單的做法,是用基於樣本比例、虛無假設比例與樣本大小的標準誤公式。

\(z = \dfrac{\hat{p} - p_{0}}{\sqrt{\dfrac{p_{0}*(1-p_{0})}{n}}}\)

我們用這個更簡單的計算方式,重新計算一次 p 值。

已提供 late_shipments,且已載入 dplyr

本練習屬於課程

R 中的假設檢定

檢視課程

動手互動練習

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

# Hypothesize that the proportion of late shipments is 6%
p_0 <- ___

# Calculate the sample proportion of late shipments
p_hat <- ___



# Calculate the sample size
n <- ___
編輯並執行程式碼