# Auswertung von Beispiel 10.2: T <- matrix(c(24,35,21,30,1355,603,192,224),nrow=4) T x1 <- c(1,1,1,2,2,3) x2 <- c(2,3,4,3,4,4) names <- c("nie","manchm.","oft","jede N.") rho.hat <- rep(1,6) a.Einz <- rep(0,6) a.Bonf <- rep(0,6) b.Einz <- rep(0,6) b.Bonf <- rep(0,6) pvl <- rep(1,6) pvr <- rep(1,6) for (i in 1:6) { xx <- c(x1[i],x2[i]) res <- fisher.test(T[xx,],alternative="two.sided") rho.hat[i] <- res$estimate a.Einz[i] <- res$conf.int[1] b.Einz[i] <- res$conf.int[2] res <- fisher.test(T[xx,],alternative="two.sided", conf.level=1-0.05/6) a.Bonf[i] <- res$conf.int[1] b.Bonf[i] <- res$conf.int[2] res <- fisher.test(T[xx,],alternative="less") pvl[i] <- res$p.value res <- fisher.test(T[xx,],alternative="greater") pvr[i] <- res$p.value } pv <- cbind(pvl,pvr) pvH <- p.adjust(pv,method="holm") pvl.Holm <- signif(pvH[,1],digits=5) pvr.Holm <- signif(pvH[,2],digits=5) pvl <- signif(pvl,digits=5) pvr <- signif(pvr,digits=5) rho.hat = round(rho.hat,digits=4) a.Einz = floor(10000*a.Einz)/10000 a.Bonf = floor(10000*a.Bonf)/10000 b.Einz = ceiling(10000*b.Einz)/10000 b.Bonf = ceiling(10000*b.Bonf)/10000 data.frame(names[x1],names[x2],rho.hat,a.Einz,b.Einz,a.Bonf,b.Bonf) data.frame(names[x1],names[x2],pvl,pvr,pvl.Holm,pvr.Holm)