開始使用免費開始

臨界區的樣本數

使用小型與大型資料集的隨機化分佈,計算不同的顯著性臨界值。請記得,你最關心的是晉升率的「正向差異很大」的情況,所以要計算 0.90、0.95、0.99 的上分位數。

用來計算這些分位數的函式 calc_upper_quantiles() 已在指令碼中提供。

本練習屬於課程

R 統計推論基礎

檢視課程

練習說明

  • 先作為參考,執行對 calc_upper_quantiles() 的呼叫,計算與原始資料集(含 1000 個置換差異)disc_perm 對應的分位數。
  • 對小型資料集 disc_perm_small 做相同的計算…
  • 以及對大型資料集 disc_perm_big 也做一次。

動手互動練習

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

calc_upper_quantiles <- function(dataset) {
  dataset %>% 
    summarize(
      q.90 = quantile(stat, p = 0.90),
      q.95 = quantile(stat, p = 0.95),
      q.99 = quantile(stat, p = 0.99)
    )
}

# Recall the quantiles associated with the original dataset
calc_upper_quantiles(disc_perm)

# Calculate the quantiles associated with the small dataset
___

# Calculate the quantiles associated with the big dataset
___
編輯並執行程式碼