Bootstrap p value significantly different from t-test p value

醉酒当歌 提交于 2019-12-23 04:55:26

问题


I am trying to figure out whether there is significant difference between two sample sets by calculating the p-value through bootstrapping and the t-test. However, I get p = 0.49 when I do bootstrapping and 7.015e-11 when I use the t-test. I'm quite confused as to why there is such a large difference between the two p-values. Below is the code for my bootstrap:

diff <- function(data, k) {
    s = data[, 1:25]
    n = data[, 26:100]
    mean <- tapply(s[, k], n[, k], mean)
    mean[1] - mean[2]
}
b = boot(d, diff, 10000)
p = mean(abs(b$t) > abs(b$t0))

来源:https://stackoverflow.com/questions/42666854/bootstrap-p-value-significantly-different-from-t-test-p-value

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!