如何测试两条ROC曲线的AUC是否不同?
我必须测试(两个分类器的)两条ROC曲线的AUC是否不同,或者没有使用置换测试(我不能使用如何测试两条ROC曲线的AUC是否不同?,r,roc,auc,statistical-test,R,Roc,Auc,Statistical Test,我必须测试(两个分类器的)两条ROC曲线的AUC是否不同,或者没有使用置换测试(我不能使用ROC.test函数,这是大学的练习) 经过一些研究,我尝试使用Mann-Whitney测试,但我确定这不是一个好的解决方案,我不知道如何找到好的解决方案。在大学里,我们看到了相同的算法,用t检验比较两种平均值,但不是比较2 AUC的情况。我应该使用什么测试?我应该用不同的算法吗 这是我的密码: pred1 = prediction(prob1,y) # pred1 is my first classif
ROC.test
函数,这是大学的练习)
经过一些研究,我尝试使用Mann-Whitney测试,但我确定这不是一个好的解决方案,我不知道如何找到好的解决方案。在大学里,我们看到了相同的算法,用t检验比较两种平均值,但不是比较2 AUC的情况。我应该使用什么测试?我应该用不同的算法吗
这是我的密码:
pred1 = prediction(prob1,y) # pred1 is my first classifier
perf1.auc = performance(pred1, measure = "auc")
auc1<-perf1.auc@y.values[[1]] # first AUC (= 0.919357)
pred2 = prediction(prob2,y) # pred2 is my second classifier
perf2.auc = performance(pred2, measure = "auc")
auc2<-perf2.auc@y.values[[1]] # second AUC (= 0.9412217)
t0 = wilcox.test(auc1,auc2,paired=FALSE)$statistic # Tried a Mann Whitney test, not the good solution
pred1=prediction(prob1,y)#pred1是我的第一个分类器
perf1.auc=性能(pred1,measure=“auc”)
AUC1您看过roc.test的文档了吗?它包含一些应该与您的任务相关的指针……您看过roc.test的文档了吗?它包含一些应该与您的任务相关的指针。。。
z = c(prob1,prob2)
set.seed(27)
B = 1000 # Number of iterations
t.perm = numeric(B)
for(b in 1:B){
z1 = sample(z, replace = F) # Resampling
prob11 = z1[1:length(prob1)]
prob22 = z1[(length(prob1)+1):length(z1)]
pred11 = prediction(prob11,y)
perf11.auc = performance(pred11, measure = "auc")
auc11<-perf11.auc@y.values[[1]]
pred22 = prediction(prob22,y)
perf22.auc = performance(pred22, measure = "auc")
auc22<-perf22.auc@y.values[[1]]
t.perm[b] =wilcox.test(auc11,auc22,paired=FALSE)$statistic # Tried a Mann Whitney test, not the good solution
}
t.perm = c(t.perm, t0)
pval = mean(abs(t.perm) >= abs(t0))