開始使用免費開始

單次置換的卡方統計量

在虛無假設為獨立的情況下產生資料的關鍵是「置換」(permutation)。先產生一個資料集,看看在兩個變數其實彼此獨立時,你可能會觀察到什麼樣的卡方統計量。

本練習屬於課程

R 中的類別資料推論

檢視課程

動手互動練習

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

# Create one permuted dataset
___ <- ___
  # Specify the variables of interest
  ___
  # Set up the null
  ___
  # Generate a single permuted dataset
  ___
編輯並執行程式碼