計算樣本平均
late_shipments 資料集包含醫療用品運送的供應鏈資料。每一列代表一次零件的運送。late 欄位表示該零件是否延遲送達。值為 "Yes" 代表延遲送達,值為 "No" 代表準時送達。
先從計算點估計(樣本統計量)開始分析,也就是「延遲送達比例」。
已提供 late_shipments;已載入 dplyr。
本練習屬於課程
R 中的假設檢定
練習說明
- 使用
View()檢視late_shipments資料集。 - 計算樣本中延遲送達的比例。也就是在
late欄位為"Yes"的情況下取平均。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# View the late_shipments dataset
View(late_shipments)
# Calculate the proportion of late shipments
late_prop_samp <- ___
# See the results
late_prop_samp