This commit is contained in:
agdamsbo 2018-10-22 14:07:44 +02:00
parent 46328c1f13
commit c84b971ab7

View File

@ -15,22 +15,22 @@ rep_epi_tests<-function(gold,test,data){
require(epiR) require(epiR)
d<-data d<-data
test<-d[,c(test)] tst<-d[,c(test)]
gs<-d[,c(gold)] gs<-d[,c(gold)]
ls<-list() ls<-list()
if (length(gold)==1){ if (length(gold)==1){
for (i in 1:ncol(test)){ for (i in 1:ncol(tst)){
t<-table(test[,i],gs) t<-table(tst[,i],gs)
rval <- epi.tests(t, conf.level = 0.95) rval <- epi.tests(t, conf.level = 0.95)
n<-names(test)[i] n<-names(tst)[i]
ls[[i]]<-list(n,rval) ls[[i]]<-list(n,rval)
}} }}
else { else {
for (i in 1:ncol(gs)){ for (i in 1:ncol(gs)){
t<-table(test,gs[,i]) t<-table(tst,gs[,i])
rval <- epi.gss(t, conf.level = 0.95) rval <- epi.gss(t, conf.level = 0.95)
n<-names(gs)[i] n<-names(gs)[i]
ls[[i]]<-list(n,rval) ls[[i]]<-list(n,rval)