從 H0 產生資料
想像你在讀報時,看到有人聲稱:「所有美國人中有 3/4 相信有來世。」這可以被詮釋為一個「點」虛無假設,表示母體比例為 0.75。
請用這個假設產生一組資料來探索。
本練習屬於課程
R 中的類別資料推論
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Generate one dataset under H0
sim1 <- gss2016 %>%
# Specify the response and success
___(response = ___, success = ___) %>%
# Hypothesize the null value of p
___(null = ___, p = ___) %>%
# Generate a single simulated dataset
___(reps = ___, type = ___)
# See the result
sim1