# Auswertungen fuer Beispiel 10.1: ds <- read.table("StatWiSo2003.txt",header=TRUE) T <- table(ds$ZufZiffer) # Simultane Konfidenzintervalle fuer die # 10 Wahrscheinlichkeiten p[j] = Pr(Ziffer j-1): source("MultinomSimCBs.R") MultinomSimCBs(Table=T,alpha=0.05) # P-Werte fuer die 20 Nullhypothesen # H_j : p[j] >= 0.1 # bzw. # H_{10+j} : p[j] <= 0.1 # mit und ohne Holms Adjustierung: n <- sum(T) PV <- matrix(1,nrow=10,ncol=2) for (j in 1:10) { PV[j,1] <- pbinom(T[j],n,0.1) PV[j,2] <- 1 - pbinom(T[j]-1,n,0.1) } PVH <- p.adjust(PV,method="holm") cbind(T, T/n, PV, PVH) # zu Fuss: PV1 <- sort(PV) PV2 <- pmin((20:1)*PV1,1) PV3 <- PV2 for (i in 2:20) { PV3[i] <- max(PV3[i-1],PV3[i]) } cbind(1:20,PV1,PV2,PV3)