sigma <- function(unten=1, oben=6) { x = unten:oben n = length(x) m = mean(x) sqrt((sum(x^2)/n - m^2)) } proben <- function(unten=1, oben = 6, k = 10, N = 50) { # default: wir werfen 10 Wuerfel 50 Mal alle <- NULL for(j in 1:N){ ergebnis = mean(sample(unten:oben, k, replace=T)) alle = c(alle, ergebnis) } alle } sigma()/sqrt(5) qnorm(0.025, 3.5, sigma()/sqrt(5)) qnorm(0.975, 3.5, sigma()/sqrt(5)) a = proben(1, 6, 5, 100) sum(a < 2 | a > 5) werte = c( 6, 5, 6, 9, 6, 5, 6, 8, 5, 6, 10, 9) shut = sd(werte) SEhut = shut/sqrt(12) curve(dnorm(x, 0, 1), -4, 4) curve(dt(x, 3), -4, 4, add=T, col="blue") curve(dt(x, 10), -4, 4, add=T, col="red") mu = 6 n = length(werte) SEhut = sd(werte)/sqrt(n) # eingeschätzter SE frei = n - 1 # Freiheitsgrade mu + SEhut * qt(0.025, frei) # untere Grenze mu + SEhut * qt(0.975, frei) # obere Grenze mean(werte) mx = 200 sx = 20 nx = 20 my = 220 sy = 30 ny = 35 x = c(20, 15, 19, 22, 17, 16, 23, 18, 20) y = c(18, 15, 17, 24, 15, 12, 14, 11, 13, 17, 18) SE2(x, y)