評估幹細胞治療的效果(續)
進行假設檢定並計算 p 值,以評估對照組與治療組綿羊心臟在平均泵血能力上是否存在差異。
因為我們要檢定的是「差異」,減法的先後順序很重要。你可以在 calculate() 函式中用 order 參數指定。例如,若要計算 group1 - group2,請使用 order = c("group1", "group2")。
本練習屬於課程
R 數值資料推論
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
n_replicates <- 1000
# Generate 1000 differences in means via randomization
diff_mean_ht <- stem.cell %>%
# y ~ x
specify(___ ~ ___) %>%
# Null = no difference between means
hypothesize(null = "___") %>%
# Shuffle labels 1000 times
generate(reps = ___, type = "___") %>%
# Calculate test statistic
calculate(stat = "___", order = c("esc", "___")