#Pr.c.1 - Alternativni rozdeleni n <- 150 alpha <- 0.05 c <- 0.3 M <- 38/n #H0: theta = 0.3 #H1: theta < 0.3 #Testovani kritickym oborem (t0 <- (M-c)/sqrt(c*(1-c)/n)) #testovaci statistika -qnorm(1-alpha) #horni hranice kritickeho oboru #W = ( -infty ; -1.645) #t0 = -1.247 nenalezi do kritickeho oboru W => H0 nezamitame na asymptoticke hladine vyznamnosti alpha=0.05. #Testovani pomoci IS (hh <- M-sqrt(M*(1-M)/n)*qnorm(alpha)) #horni hranice IS #95% IS pro parametr theta je (-infty , 0.3117) #0.3 nalezi do IS => H0 nezamitame na asymptoticke hladine vyznamnosti alpha=0.05. #Pr.c.2 - podil dvou rozptylu: X1 <- c(62,54,55,60,53,58) X2 <- c(52,56,49,50,51) s1 <- sd(X1) s2 <- sd(X2) #H0: s1^2/s2^2=1 #H1: s1^2/s2^2 se nerovna 1 #Testovani kritickym oborem (t0 <- s1^2/s2^2) #testovaci statistika alpha <- 0.05 n1 <- length(X1) n2 <- length(X2) qf(alpha/2,n1-1,n2-1) qf(1-alpha/2,n1-1,n2-1) #Kriticky obor ma tvar: W=(-infty ; 0.1354> U <9.3645 ; infty) #t0 = 1.7534 nenalezi do IS => H0 nezamitame na hladine vyznamnosti alpha=0.05. #Testovani pomoci IS (dh <- (s1^2/s2^2)/qf(1-alpha/2,n1-1,n2-1)) #dolni hranice IS (hh <- (s1^2/s2^2)/qf(alpha/2,n1-1,n2-1)) #horni hranice IS #IS ma tvar (0.1872 ; 12.9541) #1 nalezi do IS => H0 nezamitame na hladine vyznamnosti alpha=0.05.