########### # Blatt 8 # ########### #aufgabe 4 Tore<-rbinom(100, 190, 0.24) p.wert<-sapply(Tore, function(x) binom.test(x, 190, 0.24)$p.value) sum(p.wert < 0.05) #100 mal wiederholen sim<-function(Tore){ p.wert<-sapply(Tore, function(x) binom.test(x, 190, 0.24)$p.value) } P.WERT<-replicate(100, sim(rbinom(100, 190, 0.24))) sum(P.WERT < 0.05) resultat<-apply(P.WERT, 2, function(x) sum(x < 0.05)) table(resultat) round(dbinom(0:10,100, 0.05)*100)